ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Berry <>
Subject RE: newbie - if-then-else task?
Date Tue, 04 Dec 2001 18:55:59 GMT
There is always the user-supplied IfTask -- available in the archives of
this list. Of course, this means that you must build an optional.jar, or in
some way make this Task available to Ant. This is what I am using, and
apparently has the syntax you are also requesting. 
-- Chris

 -----Original Message-----
 From: Diane Holt []
 Sent: Tuesday, December 04, 2001 11:55 AM
 To: Ant Users List
 Subject: Re: newbie - if-then-else task?
 --- Russ Fink <> wrote:
 > Okay - I think I understand.  If I have 'dirs.orig' pointing to the
 > global area, and dirs.local pointing to the local modified area, and
 > want to put the file into 'dest', I can do the following:
 > <property name="frompath" value="${dirs.orig}/foo"/>
 > <available file="${dirs.local}/foo" property="frompath"
 >            value="${dirs.local}/foo"/>
 > <copy file="${frompath}" todir="${dirs.base}/dest"/>
 I thought for sure Erik would reply to this, since it's using 
 in the very way he's currently trying to disallow, but...
 Anyway, yes, you -could- do it this way, but only because <available>
 allowed resetting the value of a property, which (according to Ant's
 "immutable properties" stance) it shouldn't really have been doing, and
 will now bark at you should you try to use it this way (and may well at
 some point not allow it at all).
 > (This is still a little more work than I indended, [...]
 Well, Ant is exactly known for being all that succinct :)  And if you
 think the above is a bit roundabout, you'll probably be not at 
 all fond of
 how you should really be doing it, which would involve several targets,
 using "depends" and "unless".
 Do You Yahoo!?
 Buy the perfect holiday gifts at Yahoo! Shopping.
 To unsubscribe, e-mail:   
For additional commands, e-mail: <>

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

View raw message