You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jamie Lawrence <ja...@broadcom.ie> on 2001/06/27 12:07:31 UTC
Properties not set properly after
Why do properties in a target only get set if the target is called from the
cmd-line or init, but aren't set when called using antcall?
For example, if I call "ant pc compile" everything work fine (the pc target
sets a property pc, compile then calls the pc.xml file and if the pc
property is set execute the compile target there). However, when I call
"ant all compile" the pc property isn't set!
Script extracts below. Odd?
Jamie
---------------------------------------------------------
in build.xml...
<target name="all">
<antcall target="pc"/>
<antcall target="palm"/>
<antcall target="compile"/>
</target>
<target name="pc">
<property name="pc" value="true"/>
<echo>PC Property set</echo>
</target>
<target name="palm">
<property name="palm" value="true"/>
</target>
<target name="compile">
<ant antfile="pc.xml" target="compile" dir="${root}"/>
<ant antfile="palm.xml" target="compile" dir="${root}"/>
</target>
---------------------------------------------------------
in pc.xml...
<target name="compile" if="pc" >
<echo>Called PC compile</echo>
</target>
Re: Properties not set properly after
Posted by Stefan Bodewig <bo...@apache.org>.
Jamie Lawrence <ja...@broadcom.ie> wrote:
> Why do properties in a target only get set if the target is called
> from the cmd-line or init, but aren't set when called using antcall?
They are set, but only for the duration of the antcall. When you use
<antcall>, you get a copy of your current project and work on that -
there is no way to feed back information from that copy to your
original project.
Stefan