ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Amerige <>
Subject Re: Macrodef and If
Date Wed, 09 Nov 2011 11:52:04 GMT
Hi Stefan,

Thanks for your reply.  This won't work because the macrodef won't have any knowledge of what
to do as per my need.  I think, 
therefore, my solution of having 2 macrodef elements is as close as I can get:


So, then the question shifts a bit: in a macrodef, assuming that an element has optional="true",
is there a way to test whether the 
element, in fact, is being used by the caller?  This might be useful information to know inside
the definition of the macrodef.

Thanks for your response, again!

Steve Amerige
SAS Institute, Deployment Software Development

On 11/8/2011 11:49 PM, Stefan Bodewig wrote:
> No.  macrodef can only be used to define tasks, not conditions (which is
> what you'd need).
> What you can do is what Mike suggests.  Use your macrodef to set a
> property and then use isset as condition inside your if.
>      <mymacrodef property="foo"/>
>      <if>
>      <isset property="foo"/>
>      <then>
>           ...
>      </then>
>      </if>

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