ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Vernum <Tim.Ver...@macquarie.com.au>
Subject RE: Two issues
Date Sun, 18 Feb 2001 22:54:34 GMT
> I use local parameters to parameterize the differences,
> e.g.:
> 
>     <target name="c1" depends="blah">
>         <property name="my.name" value="c1"/>
>         <property name="my.output" value="${out$}/${my.name}"/>
>         ... then compile and create JAR file here...
>     </target>
> 
> In this scenario, Ant does execute the "c2" target first, but when it
> comes back to execute the "c1" target, the local property 
> ${my.name} is
> bound to the value in "c2", not the value that I set it to in "c1".
> Thus the target doesn't do the right thing since its name property is
> incorrect.  Is this the correct behavior?

Yes.
There is no such thing as "local properties".
Properties to not have scope.
They are set when the <property> tag is met, and not changed again.

You might look at using AntCall for what you are doing.

> I did discover another issue.  If I specifically build just
> the "c1" target and the "c2" target has not been created, then Ant
> (actually javac I assume) automatically includes the Java 
> files from the
> "c2" target that "c1" depends on because all of the classes are in the
> same src tree. 

What fileset are you using?

> The interesting thing is that Ant correctly 
> states that
> is is compiling 14 files (which I counted), but the result from the
> compiler includes classes from the "c2" package.  

run ant with -verbose and -debug, to see what it's doing under the hood.

> Both of these issues are avoidable, but annoying.  Am I doing 
> something
> incorrectly here?

In the property case, yes.
In the javac case, most likely, but I can't tell without seeing your build file.

Mime
View raw message