ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Using "if" in a target?
Date Mon, 18 Sep 2000 06:53:47 GMT
Just want to add a little rationale to one thing. Other than that
there is nothing to add to Nico's post.

>>>>> "DH" == Diane Holt <> writes:

 DH> I have another target that depends on nsync, which I assumed
 DH> would mean "If nsync doesn't get run (or if it runs but fails),
 DH> don't run this one"

No, each target checks its own properties and nothing else. This is
very usefull in cases like this:

<available property="jdk1.2+" classname="java.lang.ThreadLocal" />

<target name="main" depends="jdk1.1main,jdk1.2+main" />

<target name="jdk1.1main" unless="jdk1.2+" ...
<target name="jdk1.2main" if="jdk1.2+" ...

where jdk1.1main and jdk1.2main do the same, just a little bit
different. If you run target main, you can be sure whatever you wanted
to do happened and the "correct" way has been used.


View raw message