ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniels, Doug" <>
Subject RE: Assign new value to an existing property
Date Fri, 30 Apr 2004 12:41:06 GMT
You can try using the ant-contrib( <variable> task:

"The Variable task provides a mutable property to Ant and works much like variable assignment
in Java. This task is similar to the standard Ant Property task, except that THESE PROPERTIES
ARE MUTABLE. While this goes against the standard Ant use of properties, occasionally it is
useful to be able to change a property value within the build. In general, use of this task
is DISCOURAGED, and the standard Ant Property should be used if possible. Having said that,
in real life I use this a lot." 


To use the ant-contrib tasks download the ant-contrib jar, then in your build file place this
<taskdef> at the top:
<taskdef resource="net/sf/antcontrib/">
    <pathelement location="/usr/share/java/lib/ant-contrib-0.3.jar"/>

With the location pointing to where you downloaded your jar of course. A million thanks to
the ant-contrib people for producing such useful tasks. I've always been kind of confused
why most of the tasks aren't included in the regular ant distribution, I guess its that whole
minimalist approach and you can always just download these tasks.

~ Doug Daniels

-----Original Message-----
From: Paul Martel []
Sent: Friday, April 30, 2004 8:25 AM
Subject: Assign new value to an existing property

Hi !

I defined a property X with a value.  Later in my Ant script, I would like to change the value
of X.  Is it the kind of thing that I can do with Ant ?  At first glance, it seems not possible
with a test that I have done.

Thank you

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

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

View raw message