ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <JFernan...@viquity.com>
Subject RE: Persistence of Property
Date Wed, 25 Oct 2000 18:55:08 GMT
Well, I do not think we can call it "by design", I would say
it is a feature. The issue to keep in mind here is that
<antcall> does not execute on the same "context" as the caller.
It is actually calling the execution of a different project that
just happens to be the same as the one we are executing.

This means that the properties defined during its execution will be reset
at the end on the <antcall>, and hence the funny behaviour.

The following targets will produce your expected output:

<target name="main" depends="pre,dosomething" >
	<echo message="Ending Main:${test.prop}" />
</target>

<target name="pre">
	<echo message="Starting main:${test.prop}" />
</target>

<target name="dosomething">
	<property name="test.prop" value="isSet" />
	<echo message="in dosomething:${test.prop}" />
</target>


> From: Charles Tewksbury [mailto:tewks@adhesive.com]
> 
> Question about the property tag and release 1.2.
> 
> From "What's New"; it states:${} expansion now happens at runtime and
> <property> tags
> living inside of targets only take effect if they are visited at
> runtime.
> 
> Does this property get set to a "project level"  For instance:
> 
> <target name="main">
> 	<echo message="Starting main:${test.prop}" />
> 	<antcall target="dosomething" />
> 	<echo message="Ending Main:${test.prop}" />
> </target>
> 
> <target name="dosomething">
> 	<proprty name="test.prop" value="isSet" />
> 	<echo message="in dosomething:${test.prop}" />
> </target>
> 
> produces the following output:
> 	main:
> 	Starting main:${test.prop}
> 
> 	dosomething:
> 	in dosomething:isSet
> 	Ending Main${test.prop}
> 
> It seems to me, that once the property is set, it should 
> remain set until
> the Project is done.  Is what is happening currently a bug or 
> by design?
> 
>  - Charles Tewksbury
> 

Mime
View raw message