ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: condition shortcutting
Date Tue, 15 Jan 2002 03:25:09 GMT
From: "Steve Loughran" <steve_l@iseran.com>

> no, it is like we dont bother evaluating any conditions if the dest
property
> is already set, because the immutability rules imply that the condition
> cannot change the value of the property anyway.

I know it has been advised, but property immutability is
not a rule, IIRC.

>
> So it's about 2 lines of code in Condition.java, which is why I didnt
bother
> mentioning it. I will post it later, when I have it to hand, but roughly
it
> goes into execute as
>
> if(project.getProperty(property)!=null) {
>     //eval the condition
> }
>

Oh, I get what you are saying now.

> <condition "box.offline">
>  <or>
>   <isset property="box.offline"/>
>   <http url="http://apache.org/>
>  </or>
> </condition>
>

I like this (the existing way) because it lets the user construct
the condition explicitly.  But I do not have a strong opinion
on you doing it the way you propose - I guess you are
suggesting it mainly for performance reasons rather than for
the user to have to type an extra Or condition...

Cheers,
Magesh




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


Mime
View raw message