ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: conditional attributes for arg and env elements
Date Wed, 26 Jul 2006 21:52:15 GMT
--- Jesse Glick <jesse.glick@sun.com> wrote:

> 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"/>
>    </exec>
> </target>
> 
> vs. (ack!)
> 
> <target name="x"
> depends="x-predef-with-opt,x-predef-without-opt">
>    <x-exec .../>
> </target>
> <target name="x-predef-with-opt">
>    <presetdef name="x-exec">
>      <exec>
>        <arg value="-opt"/>
>      </exec>
>    </presetdef>
> </target>
> <target name="x-predef-without-opt">
>    <presetdef name="x-exec">
>      <exec/>
>    </presetdef>
> </target>
> 
> 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.

Point taken, but this quickly leads back to the
"should all element-level entities support if/unless"?
 Once again, I forget what the arguments were
for/against.  IIRC DD was a supporter of "if/unless
everywhere"; maybe he can summarize off the top of his
head.  ATM I can't think why this would be A Bad
Thing.

-Matt

> 
> -J.
> 
> -- 
> jesse.glick@sun.com  x22801  netbeans.org 
> ant.apache.org
>        http://google.com/search?q=e%5E%28pi*i%29%2B1
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message