ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: why not conditions on tasks as on targets?
Date Wed, 16 Jul 2003 18:41:45 GMT
On Wednesday, July 16, 2003, at 12:46  PM, Daniel Barclay wrote:
> Do you have any targets that are separate targets solely for the
> purpose of checking something and setting a flag property that is
> used to control another target?

Yes, but the only one I'm using in my production build currently is to 
make up for a deficiency in the Axis wsdl2java dependency checking, 
where I have an <uptodate> condition to bypass generation if everything 
is current.  So the only reason I use it is because the task I'm using 
isn't clever enough internally.

> If so, wouldn't it good to have the ability to set the flag in one
> task in a target and then use the flag in a subsequent task in the
> same target, to avoid having to create a separate target just because
> of the the conditional execution?

Again, I personally do not feel Ant should become a scripting language. 
  Its best left *declarative*.  Obviously my opinion is merely one - 
others certainly disagree and that is fine.

>> I am against Ant becoming a scripting language,
> But copying the existing conditional-execution constructs ("if" and
> "unless" on targets) to tasks wouldn't make Ant any more if a scripting
> language than it already is.  (Note that I'm not even talking about
> script tasks.)

Again my opinion is based on my experience.  I've not had a need for 
conditional tasks, so therefore don't see a strong reason to add it.  
Others can differ in opinion and push it through and I won't put up a 
fight about it.

>> Scriptlets are not something I use.  If something requires more 
>> complex logic in JSP, I write a taglib.  If something requires more 
>> logic in Ant, I write a task.
> Note that JSPs don't force an abrupt transition on the user.  Each
> JSP user can choose whether to add a little Java or take the step
> of creating a custom tag library.

JSP's *should have* made it more rigorous though.  And isn't there a 
feature in the new JSP spec to add creating "script" taglibs?  That, in 
my opinion, is the better way to go.

> Ant already provides constructs for composing tasks into higher-level
> tasks without having to write a custom tasks for everything new (e.g.,
> conditional targets, condition checks like Available and Uptodate).
> Why shouldn't those constructs be more regular and more orthogonal?

Or we can turn it around and ask why shouldn't folks code their build 
files to be more declarative and push logic/iteration into tasks, 
whether they are script or Java?  Or why not control your build with 
Jython calling Ant tasks?

Its a regular debate and certainly an interesting one.  I'm not going 
to be able to keep up with this thread too tightly, but I've conveyed 
my thoughts on it.


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

View raw message