ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Gemis" <marc.gemis...@belgium.agfa.com>
Subject Problems with use of 'if'
Date Wed, 26 Jul 2000 15:03:49 GMT
During my search for a solution on the build files in multiple dirs, I made
a similar construct
as below. I tried it with latest nightly build available through website.
Now depending on whether I put target t2 or target t1 at the top, I get
different results. (prop is either t1 or t2)
A bug or am I missing something ? I expect to always see t1 printed in
target test and while the message from target t2 never gets printed, the
value of prop gets set there.


<project name="test" default="test">

<target name="t2" depends="init" if="var2">
 <echo message="t2"/>
 <property name="prop" value="t2"/>
</target>

<target name="t1" depends="init" if="var1">
 <echo message="t1"/>
 <property name="prop" value="t1"/>
</target>

<target name="init">
 <available file="test.xml" property="var1"/>
 <available file="../test.xml" property="var2"/>
</target>

<target name="test" depends="init,t1,t2">
 <echo message="value of prop:    ${prop}"/>
</target>

</project>

>>>>>>>> Output
Buildfile: test.xml

init:

t1:
t1

t2:

test:
value of prop:    t2

BUILD SUCCESSFUL

Total time: 0 seconds


Mime
View raw message