ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: newbie - if-then-else task?
Date Tue, 04 Dec 2001 17:54:49 GMT
--- 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 <available>
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: <>

View raw message