jastrachan | 26 Mar 11:33 2004

Re: GroovyMarkup with Ant and JUnit

On 26 Mar 2004, at 08:27, Mike Clark wrote:
> On Mar 25, 2004, at 11:54 PM, jastrachan@... wrote:
>> Neat!
>> I guess the downside though is that methods will get re-evaluated if 
>> the same dependency is shared by multiple targets. Though we could 
>> use flags inside the methods for this if its a problem. I guess we 
>> can let the programmer figure this stuff out.
> That's what I'm thinking.  As it is, the Ant tasks called inside the 
> methods (e.g. javac) will only run if they need too.  But if you have 
> some Groovy code in there, like a for loop, then it will get evaluated 
> every time.

Cool. I guess with things like javac, you may have modified the source 
code (e.g. you generated something) so calling methods again is often a 
good thing.

I've certainly had issues in the past with Ant / Maven deciding to 

* run something several times without me able to stop it doing it
* not do something twice when I want it to

So I guess leaving things simple & in the hands of the developer is a 
good thing. Folks can always derive or create clever proxies and stuff 
for doing more advanced things.

> So I can see where mixing Ant with a full-blown scripting language 
> (Groovy!) gives you a lot of options for relatively complex build 
> processes.  I prefer this over embedding Groovy scripts inside Ant 
> build files using <scriptdef>.  Well, and you get out of the angle 
> bracket world, too.  :-)

Yay! :). Totally agreed. Its taken me a while to get there (after 
dom4j, JSP tag libs & Jelly) but I'm finally backing off all those 
angle brackets.

Paul Hammant has made me a T-Shirt that says something like...

     "James Strachan, thank god he got off his XML horse"

Will have to wear it next conference I go to :)