You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Dominique Devienne <DD...@lgc.com> on 2004/03/08 18:55:37 UTC

Bug in macrodef?

I replaced the use of <antcall> with <macrodef>, which used <replace>.

The old <antcall>'d target used <replacefilter token="@${name}@">, name
being the property passed to the <antcall>.

When going with <macrodef>, I knew I had to double-up the @ chars, but
I couldn't make it to work with <replacefilter token="@@@{name}@@">

Is this user-error? Or a bug in macrodef?

As a stop-gap solution, I replace the source document to use %name%
for the tokens to be replaced... --DD

    <macrodef name="replace-module-version">
      <attribute name="name" />
      <sequential>
        <replace file="${SetupImage}/help/About.html"
 
propertyfile="${module.repository}/module-@{name}.properties">
          <replacefilter token="%@{name}%" property="version.full" />
        </replace>
      </sequential>
    </macrodef>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Bug in macrodef?

Posted by Peter Reilly <pe...@corvil.com>.
Hi Dominique,
There was a bug in macrodef's  dealing of @@ (bugzilla 27069),
fixed in current cvs.
In the meantime "@${name}@" will get mapped to "@${name}@",
as there is no attribute with the name "${name}".

Peter

Dominique Devienne wrote:

>I replaced the use of <antcall> with <macrodef>, which used <replace>.
>
>The old <antcall>'d target used <replacefilter token="@${name}@">, name
>being the property passed to the <antcall>.
>
>When going with <macrodef>, I knew I had to double-up the @ chars, but
>I couldn't make it to work with <replacefilter token="@@@{name}@@">
>
>Is this user-error? Or a bug in macrodef?
>
>As a stop-gap solution, I replace the source document to use %name%
>for the tokens to be replaced... --DD
>
>    <macrodef name="replace-module-version">
>      <attribute name="name" />
>      <sequential>
>        <replace file="${SetupImage}/help/About.html"
> 
>propertyfile="${module.repository}/module-@{name}.properties">
>          <replacefilter token="%@{name}%" property="version.full" />
>        </replace>
>      </sequential>
>    </macrodef>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org