Return-Path: Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 13739 invoked by uid 500); 9 Jun 2003 21:40:30 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 13674 invoked from network); 9 Jun 2003 21:40:29 -0000 Received: from mail14.atl.registeredsite.com (64.224.219.88) by daedalus.apache.org with SMTP; 9 Jun 2003 21:40:29 -0000 Received: from netmail.mail.registeredsite.com ([216.122.69.14]) by mail14.atl.registeredsite.com (8.12.8/8.12.9) with ESMTP id h59LeXiu028523 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Mon, 9 Jun 2003 17:40:34 -0400 Received: (qmail 54931 invoked by uid 89); 9 Jun 2003 21:41:17 -0000 Received: from unknown (HELO ehatchersolutions.com) (208.34.118.160) by mail.luxe-media.com with SMTP; 9 Jun 2003 21:41:17 -0000 Date: Mon, 9 Jun 2003 12:49:41 -0400 Subject: Re: Embedded dynamic ANT tasks. Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Erik Hatcher To: "Ant Users List" Content-Transfer-Encoding: 7bit In-Reply-To: <19034136035.20030606165319@cs.put.poznan.pl> Message-Id: <5D808B88-9A9A-11D7-A5D0-000393A564E6@ehatchersolutions.com> X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Very nice! I've dreamed of something like this for a long while (probably a few minutes after I figured out how Ant tasks are written). I believe at least the Mutant proposal had this capability too, so maybe its implementation can be revisited to compare with what you've done. I've not looked under the covers of how you implemented it, but result is great). I'm guessing you aren't using the DynamicConfigurator interface, based on a follow-up e-mail. It seems like it would be a lighter-weight way to deal with attributes and sub-elements. I'd be way psyched to have something like this added to Ant's core. Erik On Friday, June 6, 2003, at 10:53 AM, Dawid Weiss wrote: > > Dear ANT community, > > I thought one day: maybe it would be fun if I could define ANT tasks > INSIDE > the ANT script that is being executed? So it could look like this: > >> >> >> >> >> > String message; >> int min; >> int max; >> >> void setMin(int min) { >> // note how 'global' is used instead of 'this' >> // global scope refers to the task instance anyway. >> global.min = min; >> } >> >> void setMax(int max) { >> global.max = max; >> } >> >> void setMessage(String message) { >> global.message = message; >> } >> >> void execute() { >> if (message != null) >> System.out.print(message); >> for (int i=min;i> System.out.print(i); >> if (i+1 != max) System.out.print(","); >> } >> } >> ]]> >> >> >> >> >> > > > I've played with BSH and BCEL and the solution can be found at: > > http://www.cs.put.poznan.pl/dweiss/index.php/projects/bsh-binding/ > index.xml?lang=en > > I personally find it quite a useful task, even though it started > purely as > a toy and a mind-exerciser :) > > Regards, > Dawid > > _______________________ > Dawid Weiss, http://www.cs.put.poznan.pl/dweiss > Laboratory of Intelligent Decision Support Systems, Poznan UT, Poland > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org