ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <>
Subject Re: Ant scripting from Jython.
Date Fri, 13 Jun 2003 18:43:08 GMT

On Thursday, Jun 12, 2003, at 22:23 US/Pacific, Conor MacNeill wrote:


> Instead of the "script driving Ant tasks" approach, <scriptdef> is 
> more like a
> script within a task. As such, the scripts would potentially be more 
> focussed
> on the things that need to be scripty rather than doing the whole 
> build in
> the script.

Cool. My only thought here is that I've been doing quite a bit of work 
with Sherlock where you can define functionality in either JavaScript 
or XQuery and all the little scriptlets are embedded in tags. After a 
few months of playing with that approach, I've really decided that I 
dislike writing code between XML tags. Mental shifts and all that. But 
that's just a personal finding. YMMV.

Also, there's an entire discussion that could be had of where the 
control flow should be (inside or outside).

> After all, IMHO,
> copyWrapper("C:\\java\\jython_ant\\src\",
> "C:\\java\\jython_ant\\temp", project)
> doesn't end up any "better" than
> <copy file="C:\java\jython_ant\src\"
> 	  todir="C:\java\jython_ant\temp"/>

No, in this example it doesn't. But it'll be interesting to see if the 
full expressiveness of the language can be brought to bear on the 
problem. I'm not endorsing making the big shift now, but I do like 
Jonathan's approach as an experiment. If it turns out that having the 
full expressiveness of the language allows a shift in the way that you 
can do things, then great, it's a success. If all you've done is like 
you've shown above and end up with simple replacements, then it's still 
nice (though maybe not as nice) from the point of shifting logic from 
the inside of the tag to the outside.

> In terms of Jonathan's original need for wrappers, there is some 
> possibility
> that they could be auto-generated using the Ant introspection 
> facilities. One
> problem is that most Ant tasks support a multitude of attributes.

Possible. Though auto-gen code usually doesn't do that good a job at 
allowing a paradigm shift in thinking.

> Not that useful but a bit more grist for this mill. It certainly 
> showed me
> that it is hard to cram the expressiveness of the XML approach into 
> method
> calls. I had to limit myself to a very narrow subset of tasks and 
> their usage
> patterns.

It is a tradeoff. And it's one that will take a bit of experience with 
playing with a new model to figure out if its worthwhile or not. In any 
case, I'm still off playing with Mac stuff so my involvement will be 
limited to just seeing how things turn out.

James Duncan Davidson
Coder, Speaker, Author
[life live];

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message