ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <>
Subject Property element of ant task needs an "if"
Date Fri, 12 Jul 2002 01:05:23 GMT
Hi, all.

One can use the "property" elements of an "ant" task to set properties 
within the execution of that task.

As best as I can tell, though, if the property has not been set, it will 
be set within the task.  I would much prefer that the property only get 
set if it was set in the original:


<ant target="blend" dir="." antfile="blender.xml" inheritall="false">
     <property name="juice" value="orange"/>

and then within the blender.xml file, I might have

<target name="blend">
     <property name="juice" value="vaguely green juice"/>
     ... more stuff

Were there an "if" available, then I could use that to pass a property 
into the ant task, without setting it when it was not set to start with.

<ant target="blend" dir="." antfile="blender.xml" inheritall="false">
     <property name="juice" value="orange" if="juice"/>

Were I not using inheritall=false, then the called ant file would see 
the property as defined if it was defined here, but that is not an 
option if I use inheritall.

As an alternative, if we had a nested "inheritproperty" element that 
forwarded just the property named, I could accomplish this end.



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

View raw message