ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Vernum <>
Subject RE: Two issues
Date Thu, 22 Feb 2001 02:21:59 GMT
> That is why
> my two targets that don't depend on each other (but have the 
> same property
> ${}) each have their own value for that property, even 
> if one is executed
> before the other.

You are confusing parse with execute.
Ant parses your file, and sets project properties at that point (more or less).
It then executes some targets, and sets target based properties.

        <target name="A">
                <property name="prop" value="A"/>
                <echo message="(A) PROP = ${prop}"/>

        <target name="B">
                <property name="prop" value="B"/>
                <echo message="(B) PROP = ${prop}"/>

        <target name="C" depends="B">
                <property name="prop" value="C"/>
                <echo message="(C) PROP = ${prop}"/>

if you do
	ant A B C
then it will print out PROP = A, each time.

if you do
	ant B C A
then it will print out PROP = B, each time.

but, if you do
	ant C A B
then it will implicitly run B before C, due to the dependencies, 
 and will print out PROP = B, each time.

It's all about order of execution.
The "sub-ordinate" relationship you speak of, is a direct
 influence on order of execution, but it is the order of
 execution that is demonstrating the behaviour you see.

View raw message