Bug 53797 - Path task does not expand properties in id attribute
Summary: Path task does not expand properties in id attribute
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.9.1
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-29 12:37 UTC by Dalibor Novak
Modified: 2013-05-22 03:39 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dalibor Novak 2012-08-29 12:37:06 UTC
The following script fails to create the path with refid 'c'.

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <!-- (a) Make a path without any expansion -->
    <path id="a">
        <pathelement location="${user.home}"/>
    </path>
    <property name="aPath" refid="a"/>
    <echo message="aPath=${aPath}"/>

    <!-- (b) Make a path inside a macro using macro attribute expansion to get the path id -->
    <macrodef name="make-path">
        <attribute name="pathId"/>

        <sequential>
            <path id="@{pathId}">
                <pathelement location="${user.home}"/>
            </path>
        </sequential>
    </macrodef>

    <make-path pathId="b"/>
    <property name="bPath" refid="b"/>
    <echo message="bPath=${bPath}"/>

    <!-- (c) Make a path using property expansion to get the path id -->
    <property name="cName" value="c"/>
    <path id="${cName}">
        <pathelement location="${user.home}"/>
    </path>
    <property name="cPath" refid="c"/>
    <echo message="cPath=${cPath}"/>
</project>