ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Gemis" <>
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 name="t1" depends="init" if="var1">
 <echo message="t1"/>
 <property name="prop" value="t1"/>

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

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


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




value of prop:    t2


Total time: 0 seconds

View raw message