ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Corley <>
Subject Re: Dynamic macro dispatch.
Date Tue, 24 Mar 2009 12:43:06 GMT
You'd probably be better have individual properties as flags for each macro.
So something like:
<condition property="flagA">
<equals arg1="${x} arg2="a"/>
<condition property="flabB">
<equals arg1="${x} arg2="b"/>
<condition property="flagC">
<equals arg1="${x} arg2="c"/>
<target name="RunMacroA if="flagA">
<target name="RunMacroB if="flagB">
<target name="RunMacroC if="flagC">

So you set individual properties depending on the value of ${x}. The
individual properties can then be used to determine whether particular
targets containing each macro are run.

On Tue, Mar 24, 2009 at 12:35 PM, 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:
> For additional commands, e-mail:

"To be or not to be. That's not really a question." - Jean-Luc Godard

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message