ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pontarelli <br...@pontarelli.com>
Subject Re: Dynamic macro dispatch.
Date Tue, 24 Mar 2009 16:15:12 GMT
You can invoke macros easily from Java or Groovy. Groovy is easier,  
but if you want to write a task, it isn't too difficult. You can check  
out the various macroforeach tasks around to get an idea of what you  
need to do. Or just invoke it from groovy like:

<groovy>
ant."${x}"(...)
</groovy>

Pretty certain that is the correct syntax, but you might want to  
verify that in the groovy docs.
-bp


On Mar 24, 2009, at 6:35 AM, Felix Dorner wrote:

> Hi Ant users,
>
> I have three macros: a, b, c, and a property 'x'. Is there a way to  
> execute the macro ${x}, i.e. a if ${x}=a, b if ${x}=b, c if ${x}=c,  
> (fail otherwise) with ant core? Something like <macroExec macro="$ 
> {x}"/>
>
> Thanks,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


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


Mime
View raw message