ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Lyon <...@y12.doe.gov>
Subject Without dynamic properties, how are you supposed to ...?
Date Thu, 05 Oct 2000 19:39:34 GMT
Note: this applies to the latest cvs build of ant, not just 1.1 (which had 
different, but still unuseful, behavior)

The current default behavior for <property>'s is that you can't override 
their values.  So how are you supposed to set a property to different 
values based on whether or not another property is defined?  The way I 
would think you would do it, is something like

<target name ="setpropsA" if="propforA">
	<property name="foo" value ="A">
</target>

<target name="setpropsB" if="propforB">
	<property name="foo" value ="B">
</target>


But this doesn't work, even if property "propforA" is not defined, and 
"propforB" is.  During the initial xml parsing, it apparently sets property 
"foo" to "A" no matter what, and this can't ever be overridden (except 
using the hacked ant I have now, which required just two line changes in 
Property.java).

I'm worried I'm missing the boat somehow.  Am I supposed to be using some 
other method to accomplish what I want?  Something trivial?

Thanks in advance.

-Brad

Mime
View raw message