ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Import clobbers ant.file?
Date Thu, 06 May 2004 13:55:58 GMT
Johan Vromans CPWR wrote:

> Given an build.xml:
>
>  <project name="main">
>   <echo message="ant.file = ${ant.file}"/>
>   <echo message="ant.file.main = ${ant.file.main}"/>
>   <import file="foo.xml"/>
>   <echo message="ant.file = ${ant.file}"/>
>   <echo message="ant.file.main = ${ant.file.main}"/>
>  </project>
>
> and foo.xml:
>
>  <project>
>   <echo message="[ant.file = ${ant.file}]"/>
>   <echo message="[ant.file.main = ${ant.file.main}]"/>
>  </project>
>
> This prints:
>
>      [echo] ant.file = /home/johanv/tmp/build.xml
>      [echo] ant.file.main = /home/johanv/tmp/build.xml
>      [echo] [ant.file = /home/johanv/tmp/build.xml]
>      [echo] [ant.file.main = /home/johanv/tmp/foo.xml]
>      [echo] ant.file = /home/johanv/tmp/build.xml
>      [echo] ant.file.main = /home/johanv/tmp/foo.xml
>
> As you can see the included file changes the value of property 
> ant.file.main (line 4), clobbering the value for the outer file (line 6).
>
> This is not hard to explain, but is this intended behaviour?

This looks like incorrect behaviour.

Peter

>
> -- Johan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message