Assuming no use of AntContrib, you can pass the name of a property to the 
Macrodef, which it would set.  This property could then be used in an Ant 
condition.  I'd give in and use AntContrib though, since it gives you an <if> 
task.


-----Original Message-----
From: Steve Amerige [mailto:steve.amer...@sas.com] 
Sent: Tuesday, November 08, 2011 9:46 AM
To: Ant Users List
Subject: Macrodef and If

I'd like to do something like:

    <if>
    <mymacrodef/>
    <then>
         ...
    </then>
    </if>

    <macrodef name="mymacrodef">
    ...
    </macrodef>


Within the macrodef, there would be places it would return true and other 
places it returns false.  I want the solution to be wholly 
in Ant (no Java, Groovy, external file use, etc.).

Is it possible?  If so, can you show an example of how the mymacrodef would be 
coded?

Thanks!
Steve Amerige
SAS Institute, Deployment Software Development

Reply via email to