ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel McAllansmith <dan...@spinsoftware.co.nz>
Subject Howto override property in deep nested <ant> calls?
Date Wed, 10 Jul 2002 03:33:27 GMT
Hello,

I can't seem to override a property when executing an <ant> target nested more 
than one <ant> call deep (example below).  I think this is perhaps the same 
situation as passing a value for the property at the command line and not 
being able to overide it in an <ant> call (or at all).

I have read emails in the archive showing how to override a property in an 
<ant> call but they only seem to work when you <ant> one deep.

Is there some way to remedy this problem?

Cheers
Daniel

Example:
If you run the following build files the <echo> in C <test> shows that the 
property is 'value set by A' not 'value set by B' as I would hope.
If you supply a command line value then that value gets echoed rather than 
'value set by A'

abuild.xml:
	<target name="test">
		<ant antfile="bbuild.xml" dir="../bdir" target="test" inheritAll="false">
			<property name="test.property" value="value set by A"/>
		</ant>
	</target>

bbuild.xml:
	<target name="test">
		<ant antfile="cbuild.xml" dir="../cdir" target="test" inheritAll="false">
			<property name="test.property" value="value set by B"/>
		</ant>
	</target>

cbuild.xml
	<target name="test">
		<echo message="In C, the value of test.property is ${test.property}"/>
	</target>


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


Mime
View raw message