ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Vromans CPWR <johan.vrom...@nl.compuware.com>
Subject Import clobbers ant.file?
Date Mon, 03 May 2004 13:00:50 GMT
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?

-- Johan

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


Mime
View raw message