You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/02/08 04:18:54 UTC

DO NOT REPLY [Bug 52621] New: Property expansion broken in macrodef

https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

             Bug #: 52621
           Summary: Property expansion broken in macrodef
           Product: Ant
           Version: 1.8.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: jglick@netbeans.org
    Classification: Unclassified


After the fix of bug #42046, the following does not work:

<macrodef name="metaproperty">
    <attribute name="name"/>
    <attribute name="value"/>
    <sequential>
        <property name="@{name}" value="${@{value}}"/>
    </sequential>
</macrodef>
<property name="choice" value="2"/>
<property name="thing.1" value="one"/>
<property name="thing.2" value="two"/>
<property name="thing.3" value="three"/>
<metaproperty name="thing" value="thing.${choice}"/>
<echo>${thing}</echo>

1.8.2 prints "two" as expected; 1.8.3 prints "${thing.${choice}}" after the
verbose-level message "Property "thing.${choice" has not been set".

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

--- Comment #2 from Matt Benson <mb...@apache.org> 2012-02-08 15:22:41 UTC ---
Jesse, the breakage is of course a bug in its own right, but as for the lack of
a portable solution being "the reason for such tricks," have you tried the
nested propertyExpander provided by the props Antlib?

Matt

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

--- Comment #4 from Stefan Bodewig <bo...@apache.org> 2012-02-12 07:30:42 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > have you tried the nested propertyExpander provided by the props Antlib?
> 
> No, by "portable" I mean using only tasks provided in the Ant distribution,

This is very limiting - and way more so than you'd expect from any other build
tool.

Putting that aside, the props antlib would be a better option if there was a
release of it ;-)

For the rest I'm going to comment in bug 42046

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org
             Blocks|                            |42046

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

Simon Steiner <ex...@nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ext-simon.steiner@nokia.com

--- Comment #5 from Simon Steiner <ex...@nokia.com> 2012-02-21 12:29:45 UTC ---
I had issue using:

    <macrodef name="test">
        <attribute name="ids"/>
        <sequential>
            <echo message="@{ids}"/>
        </sequential>
    </macrodef>

    <target name="test1">
        <test ids="${p}"/>
    </target>

    <property name="p" value="${build.drive}/build" />
    <property name="build.drive" value="a" />

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

--- Comment #3 from Jesse Glick <jg...@netbeans.org> 2012-02-08 16:13:58 UTC ---
(In reply to comment #2)
> have you tried the nested propertyExpander provided by the props Antlib?

No, by "portable" I mean using only tasks provided in the Ant distribution, and
not relying on JDK-specific assumptions such as that <script language='js'>
works. As far as I know this macrodef is the simplest such solution.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |29347

--- Comment #1 from Jesse Glick <jg...@netbeans.org> 2012-02-08 03:26:45 UTC ---
The longstanding lack of a fix for bug #29347 is the reason for such tricks, by
the way; there is no other portable workaround I know of.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|1.9.0                       |1.8.3

--- Comment #7 from Stefan Bodewig <bo...@apache.org> 2012-02-25 16:58:54 UTC ---
merged into 1.8.x branch with svn revision 1293649

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52621] Property expansion broken in macrodef

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52621

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.9.0

--- Comment #6 from Jesse Glick <jg...@netbeans.org> 2012-02-23 22:18:29 UTC ---
Fixed in revision 1292985 and FAQ updated in revision 1292986: 1.8.2 behavior
restored unless bug #42046 fix is explicitly activated (<attribute
doubleexpanding="false">).

I optimistically used "since 1.8.3" under the assumption this will get
cherry-picked to the branch and the target milestone set accordingly.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.