ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29347] New: - Nested property expansion shouldn't occur but does
Date Wed, 02 Jun 2004 18:44:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29347>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29347

Nested property expansion shouldn't occur but does

           Summary: Nested property expansion shouldn't occur but does
           Product: Ant
           Version: 1.7Alpha (nightly)
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: jax@purematrix.com


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"/>
             <sequential>
                 <property name="@{name}" value="${@{stem}.@{selector}}"/>
             </sequential>
         </macrodef>

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}}"/>
         </target>
     </project>

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.

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


Mime
View raw message