Hi all,

I'm looking to filter a macrodef element before it gets interpreted so as to change it's behavior. Here's an example of what I'm talking about:

<target name="myentrypoint">
...
<mymacro>
<%{mytask} %{myattribute}="%{myvalue}"/>
    %{myblockofcode}
</mymacro>
...
</target>

In other words, I want the definition of mymacro to do *token substitution *on the (implicit) element body and then have that changed body executed. (The token substitution algorithm, in my case, is not a simple replacement procedure but requires some more complex processing, in case that matters to this question.)

Here are my limitations:

1. My target is being called by some other Ant code. I do not have any control of what happens before I'm called, nor can I change how Ant was invoked or do any compilation.

2. Once in my target, I can use Groovy scriptdefs, Ant-Contrib, and anything 
that comes with Ant 1.7.

Can anyone suggest how this might be done? I did read "Developing with Apache Ant, Writing Your Own Task <http://ant.apache.org/manual/develop.html>," but I'm not sure if this helps considering what I have available to me. I'm hoping that since I have Groovy (essentially, Java), that something might still be possible.

Any ideas?

Many thanks,
Steve Amerige
SAS Institute, Deployment Software Development

Reply via email to