ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@mad.scientist.com>
Subject Re: Problems with use of 'if'
Date Wed, 26 Jul 2000 23:17:24 GMT
At 05:03  26/7/00 +0200, you wrote:
><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>

The problem is that property tasks are evaluated at the begining regardless
of whether target in which property exists is ever fired. Once a property
has been set once it can never be re-set. This is currently being looked at
and resolved on developers list now so it should be fixed in next version.

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Mime
View raw message