ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: using multiple properties in the 'if' and 'unless' conditions
Date Fri, 23 Jun 2006 09:59:33 GMT
Stefan Bodewig wrote:

> On Thu, 22 Jun 2006, Paul Mackay <Paul.Mackay@nokia.com> wrote:
> 
>> Has the possibility of adding multiple conditions to the target 'if'
>> and 'unless' attributes ever been considered?
> 
> Yes, but it hasn't come up often after Ant 1.4 ;-)
> 
>> Are there any reasons why this change would be a bad idea?
> 
> One of the reasons (and my main one) is that you'd soon need an
> expression language since simple listing two properties isn't enough?
> Does if="a,b" mean "either a is set or b" or "a is set and b"?
> 
> And then the example above doesn't work since "," is a legal character
> inside of property names, as is " " or any other character.  There
> could be a property named "a,b".
> 

yeah, you would need a whole new language. And it may need to be 
extensible, which makes things even more complex, as we'd add unary and 
binary functions to ant, plus a whole new syntax and related support calls.

The "obvious" language would be Xpath, but as someone who is behind 
schedule on adding xpath expression eval to something, I must warn that 
it is not easy, even with jaxen.

The <condition> logic is there, it works; new conditions are easy to 
add. its verbose, I agree, but extensible. And someone could add an 
<xpatheval> condition if they wanted. Hey, they could add a <lispeval> 
if they felt like it; with <scriptcondition> we implicitly have 
python/ruby/js conditions in there

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


Mime
View raw message