ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <>
Subject Re: conditional attributes for arg and env elements
Date Wed, 26 Jul 2006 21:00:42 GMT
Matt Benson wrote:
>> Would it be possible to add if and unless attributes to the env and
>> arg elements used in exec [...]
> if it is "defined vs. not defined" you could use conditionally
> defined presetdefs.

That is a lot more cumbersome however.

<target name="x">
   <exec ...>
     <arg value="-opt" if="opt"/>

vs. (ack!)

<target name="x" depends="x-predef-with-opt,x-predef-without-opt">
   <x-exec .../>
<target name="x-predef-with-opt">
   <presetdef name="x-exec">
       <arg value="-opt"/>
<target name="x-predef-without-opt">
   <presetdef name="x-exec">

Also the number of extra ugly targets you have to write is exponential 
in the number of distinct properties you would like to have 
conditionally affect the form of the task.


--  x22801*i%29%2B1

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message