ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Corley <davidcor...@gmail.com>
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>
<condition property="flabB">
<equals arg1="${x} arg2="b"/>
 </condition>
<condition property="flagC">
<equals arg1="${x} arg2="c"/>
 </condition>
<target name="RunMacroA if="flagA">
<macroA/>
</target>
<target name="RunMacroB if="flagB">
<macroB/>
 </target>
<target name="RunMacroC if="flagC">
<macroC/>
 </target>

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 <FDorner@zed.com> 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 be or not to be. That's not really a question." - Jean-Luc Godard

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