markgargan
Programmer
Hi folks,
Here's a very simple ant project.
<project name="test" default="testPrintPath" basedir=".">
<macrodef name="printPath">
<attribute name="path"/>
<sequential>
<pathconvert targetos="windows" property="pathString" refid="@{path}"/>
<echo message="The path @{path} is ${pathString}"/>
</sequential>
</macrodef>
<target name="testPrintPath">
<path id="aPath">
<pathelement location="c:\Z"/>
<pathelement location="c:\Y"/>
</path>
<printPath path="aPath"/>
<path id="anotherPath">
<pathelement location="c:\X"/>
<pathelement location="c:\W"/>
</path>
<printPath path="anotherPath"/>
</target>
</project>
It simply creates two paths, one is c:\Z;c:\Y and the other
is c:\X;c:\W
However, when I go to print these paths out, using my macrodef <b>printPath</b> the second path is always equal to the first path.
I've run this using verbose and I get the line
Override ignored for property pathString
Any one any ideas how do I avoid this from happening?
Thanks,
Mark.
Here's a very simple ant project.
<project name="test" default="testPrintPath" basedir=".">
<macrodef name="printPath">
<attribute name="path"/>
<sequential>
<pathconvert targetos="windows" property="pathString" refid="@{path}"/>
<echo message="The path @{path} is ${pathString}"/>
</sequential>
</macrodef>
<target name="testPrintPath">
<path id="aPath">
<pathelement location="c:\Z"/>
<pathelement location="c:\Y"/>
</path>
<printPath path="aPath"/>
<path id="anotherPath">
<pathelement location="c:\X"/>
<pathelement location="c:\W"/>
</path>
<printPath path="anotherPath"/>
</target>
</project>
It simply creates two paths, one is c:\Z;c:\Y and the other
is c:\X;c:\W
However, when I go to print these paths out, using my macrodef <b>printPath</b> the second path is always equal to the first path.
I've run this using verbose and I get the line
Override ignored for property pathString
Any one any ideas how do I avoid this from happening?
Thanks,
Mark.