ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53797] New: Path task does not expand properties in id attribute
Date Wed, 29 Aug 2012 12:37:06 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53797

          Priority: P2
            Bug ID: 53797
          Assignee: notifications@ant.apache.org
           Summary: Path task does not expand properties in id attribute
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: dalibor79@gmail.com
          Hardware: PC
            Status: NEW
           Version: 1.8.4
         Component: Core
           Product: Ant

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>

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message