ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <>
Subject Re: Filtering Macrodef Elements
Date Wed, 25 Jan 2012 15:00:45 GMT


Just at a first glance - one consideration I'd mention is that what you 
list is not syntactically correct XML...  So, I think if you wanted 
something like that you will need to preprocess and convert to an XML that 
can be processed.  Unless that is what you are saying and I've 
misunderstood ;)


On Wed, 25 Jan 2012, Steve Amerige wrote:

> 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 
> <>," 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

Scot P. Floess             RHCT  (Certificate Number 605010084735240)
Chief Architect FlossWare

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

View raw message