ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan George <>
Subject Re: if and unless attributes for all Tasks
Date Mon, 21 May 2001 17:39:11 GMT
Tim Vernum wrote:

> From: Alan George []
> > Without if/unless for tasks and using the most frequently offered
> > alternative, I would need to wrap all 31 ant calls in a
> > target.
> Well, if I understand your use case (and I'm not sure I do),
> then how's this for an alternative? (Attached buildfile)
> It's not as clean as it could be, but since I whipped it up
> in a few minutes, it's not really supposed to be.
> If it doesn't do what you need, then please (if possible)
> post your buildfile (using either 186 targets, or with task
> level if/unless) and I'll see if I can come up with an
> alternative method.
>                Name: alan.xml
>    alan.xml    Type: unspecified type (application/octet-stream)
>            Encoding: x-uuencode

I first tried this in my case and found properties to be immutable (i.e.
the available task would not change the value of the buildfile.available
property once it was set the first time).  So, your CopyProperty class
must do something to make properties mutable.  Also, I looked in CVS for
this file and did not find it.

At a high level you are doing the same thing I am, which is task level
conditional processing.  Yours uses the available task, mutable
properties and a layer of targets to get conditional processing.   It
seems to me that task level ifs are more explicit and natural in this
case.  Do you agree?


View raw message