ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <>
Subject Re: macrodef and properties
Date Fri, 14 Nov 2003 09:02:00 GMT
On Friday 14 November 2003 05:28, Jacob Kjome wrote:
> I have a macrodef where It does some work, then does a <pathconvert> which
> stores the result in a property, then something else uses that property
> value.   When I make calls to this, the first call works fine, but
> subsequent calls use the previously set property which, apparently, is set
> globally in the build.  This isn't very useful at all.  Is this going to be
> changed.  I saw the following conversations, but I'm not completely sure if
> the issues raised/fixed there affect my issue...
> Will the stuff in bug 23942 solve my issue?  If so, when is this patch
> going to be applied?  I'm using the latest 1.6 CVS.  Is my only workaround
> using <antcall>?  Wasn't the whole point of <macrodef> to get rid of the
> necessity for <antcall>?

This is the whole point of the <local/> patch - to allow <macrodef/> to
work in this fashion.

With it one can do the following:

  <target name="pathconvert">
    <macrodef name="showpathref">
      <attribute name="pathref"/>
        <local name="converted"/>
        <!-- the pathconvert will set the local property "converted" -->
        <pathconvert property="converted" targetos="unix" refid="${pathref}"/>
        <echo>Pathref ${pathref} is ${converted}</echo>

    <path id="s_xmls">
      <fileset dir="." includes="s*.xml"/>
    <showpathref pathref="s_xmls"/>

    <path id="p_xmls">
      <fileset dir="." includes="p*.xml"/>
    <showpathref pathref="p_xmls"/>


There is currently some debate in the dev list about whether <local/> should
be part of ant 1.6, and whether the macrodef's attributes should be local


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message