ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Dyke <will.d...@bbc.co.uk>
Subject User property overridden in nested ant scripts
Date Wed, 22 Aug 2001 14:17:42 GMT
I wish to use a command line property occasionally,
to override that set in a 'wrapper' script, that 
in turn calls the main script. 

However, the property set in the wrapper script appears to
override that set on the command line once the main
script is called. 

As an example, I have two scripts, dummywrapper.xml, 
and dummy.xml

========== dummywrapper.xml ===============
<project name="fakebuild" default="wrapper" basedir=".">
  <target name="wrapper">
    <ant antfile="dummy.xml" target="build-deploy">
      <property name="whoami" value="apps"/>
    </ant>
  </target>
</project>

================ dummy.xml ================
<project name="fakebuild" default="build-deploy" basedir=".">
  <target name="build-deploy">
    <property name="whoami" value="apps"/>
    <echo message="${whoami}"/>
  </target>
</project>

If I call dummy.xml, the command line property works fine, 
and the output is wd, as expected.

----
C:\ant\1.4b2\bin>ant -buildfile dummy.xml -Dwhoami=wd
Buildfile: dummy.xml

build-deploy:
     [echo] wd

BUILD SUCCESSFUL

Total time: 0 seconds
----

If, however, I call the wrapper script, the output is
apps. 

-----
C:\ant\1.4b2\bin>ant -buildfile dummywrapper.xml -Dwhoami=wd
Buildfile: dummywrapper.xml

wrapper:

build-deploy:
     [echo] apps

BUILD SUCCESSFUL

Total time: 0 seconds
-----

Any ideas?
Thanks,
Will Dyke


This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way, and notify me immediately. The contents of
this message may contain personal views which are not the views of the
BBC, unless specifically stated.

Mime
View raw message