ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davy Toch <>
Subject Quirky behaviour in how macrodef attribute values are resolved?
Date Thu, 09 Aug 2007 20:09:26 GMT
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>

  <macrodef name="test">
    <attribute name="prop2" default="${prop2}"/>
      <echo>prop2 as property  (from macrodef) : ${prop2}</echo>
      <echo>prop2 as attribute (from macrodef) : @{prop2}</echo>

The output is:

Buildfile: build.xml

     [echo] prop2 as property  (from target)   : value2-${prop1}
     [echo] prop2 as property  (from macrodef) : value2-${prop1}
     [echo] prop2 as attribute (from macrodef) : value2-value1

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:
For additional commands, e-mail:

View raw message