ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: Without dynamic properties, how are you supposed to ...?
Date Fri, 06 Oct 2000 06:29:46 GMT
>>>>> "BL" == Brad Lyon <ly6@y12.doe.gov> writes:

 BL> Note: this applies to the latest cvs build of ant, not just 1.1
 BL> (which had different, but still unuseful, behavior)

I doubt so. Latest cvs - in fact anything calling itself 1.2alpha2 or
alpha3:

<project name="test" default="all">
  <target name ="setpropsA" if="propforA">
    <property name="foo" value ="A" />
  </target>

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

  <target name="all" depends="setpropsA,setpropsB">
    <echo message="foo has the value ${foo}" />
  </target>
</project>

No property defined:

bodewig@sbodewig /tmp >ant -f test.xml 
Buildfile: test.xml

setpropsA:
setpropsB:
all:
foo has the value ${foo}

Defining the property for A:

bodewig@sbodewig /tmp >ant -f test.xml -DpropforA=1
Buildfile: test.xml

setpropsA:
setpropsB:
all:
foo has the value A

Defining the property for B:

bodewig@sbodewig /tmp >ant -f test.xml -DpropforB=1
Buildfile: test.xml

setpropsA:
setpropsB:
all:
foo has the value B

Make sure the Ant you are really using is the Ant you want to use 8^),
I guess there's an older version lurking in your CLASSPATH.

Stefan

Mime
View raw message