ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack J. Woehr" <>
Subject Possible Ant 1.7 alpha bug: property expansion.
Date Wed, 02 Jun 2004 18:37:59 GMT
I was just adding  to the Ant Wiki AntOddities page the following macrodef :

     <!-- Allows you define a new property with a value of ${${a}.${b}} which can't be
done by the Property task alone.  -->
         <macrodef name="macro.compose-property">
             <attribute name="name"/>
             <attribute name="stem"/>
             <attribute name="selector"/>
                 <property name="@{name}" value="${@{stem}.@{selector}}"/>

I wrote a quick counter-example which shows how expansions of properties in Ant is not recursive:

     <?xml version="1.0" encoding="UTF-8"?>
     <project basedir="." default="all" name="changeme">
         <target name="all">
             <property name="a" value="arf"/>
             <property name="b" value="bark"/>
             <property name="arf.bark" value="woof woof woof"/>
             <echo message="${${a}.${b}}"/>

but when I ran it, in Ant version 1.7 alpha built from CVS last night,  instead of getting
the  unexpanded value of
the overall expression which I expected:

     [echo] ${${a}.${b}}

I received the unexpected:

     [echo] ${${a}.bark}

This does not seem to me to be correct by the rules of Ant. Either the internal expansion
should be complete or not
at all ... the right term should not expand and leave the left unexpanded. It seems to me
the expected answer was
the one returned by Ant version 1.6.1 but I don't have that built now to see if the current
behavior is a regression.

Jack J. Woehr      # We have gone from the horse and buggy
Senior Consultant  # to the moon rocket in one lifetime, but
Purematrix, Inc.   # there has not been a corresponding moral # growth in mankind. - Dwight D. Eisenhower

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message