ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurdoch...@yahoo.com>
Subject RE: suggestion for if/unless syntax change
Date Fri, 22 Mar 2002 02:06:08 GMT


> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:j_a_fernandez@yahoo.com]
> Sent: Friday, 22 March 2002 10:08 AM
> To: Ant Developers List
> Subject: Re: suggestion for if/unless syntax change
>
>
> > --- Adam Murdoch <adammurdoch_ml@yahoo.com> wrote:
> > > You're not the only one.  In myrmidon, we changed if and
> unless to test
> > > the property value against true/false/yes/no (with unset still
> > > evaluating to false).
> >
>
> So, is there a way to test if a property is set? Is this coordinated with
> other things like <condition>, <available>, etc?
>
> All this things need to play toguether, well.


Absolutely.  There's a bunch of condition implementations, and you can use
whichever one you like, or invent your own.  The goal is to allow any
condition to be use whereever the standard if/unless conditions are.  At the
moment, conditions can only be used in a few places: <condition>, <waitfor>,
<fileset>, and (almost) <if>.  More on the way ...

BTW, <available> is just a condition now, rather than a task.  And it's been
split up into <class-available>, <resource-available>, <file-exists>, etc.


>
> IMHO, a much more useful thing (instead of changing completely
> the meaning of 'if')
> is to actually let it check for a particular value. I guess I
> wrote such a patch
> in ANT 1.1 (or was it 1.0).
>
>     <target .... if='prop=true'/>
>
> this is a fully backward compatible and more useful thing to have, IMO.
>

Well, arguably more useful.  This is why we want to get away from forcing a
particular test, and let the build file writer decide which is more useful
for them.  on the other hand, we do want to come up with a reasonable
default test, to use as shorthand.


Adam


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message