ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: Quirky behaviour in how macrodef attribute values are resolved?
Date Thu, 09 Aug 2007 20:51:41 GMT
This is due to
http://issues.apache.org/bugzilla/show_bug.cgi?id=42046
(properties get double-expanded in macrodefs)

Peter

On 8/9/07, Davy Toch <Davy.Toch@belgacom.net> wrote:
> I have the following script:
>
> <project default="test">
>   <property name="prop2" value="value2-${prop1}"/>
>   <property name="prop1" value="value1"/>
>   <target name="test">
>     <echo>prop2 as property  (from target)   : ${prop2}</echo>
>     <test/>
>   </target>
>
>   <macrodef name="test">
>     <attribute name="prop2" default="${prop2}"/>
>     <sequential>
>       <echo>prop2 as property  (from macrodef) : ${prop2}</echo>
>       <echo>prop2 as attribute (from macrodef) : @{prop2}</echo>
>     </sequential>
>   </macrodef>
> </project>
>
> The output is:
>
> D:\tmp>ant
> Buildfile: build.xml
>
> test:
>      [echo] prop2 as property  (from target)   : value2-${prop1}
>      [echo] prop2 as property  (from macrodef) : value2-${prop1}
>      [echo] prop2 as attribute (from macrodef) : value2-value1
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
>
> The output of the first 2 <echo>'s are what I expected, but the
> third <echo> output seems odd.
>
> Is this normal ANT behaviour, or should this be considered a bug
> for which I should open a bug report?
>
> Btw, I got this behaviour on ANT 1.6.5 and 1.7.0.
>
> Best regards,
> Davy Toch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message