On 2009-09-25, Jesse Glick <[email protected]> wrote:
> Refined proposal:
> 1. Make <target> evaluate if/unless attributes (just before deciding
> whether or not to run the target).
it already does (and has done so in the past).
> 2. Introduce Project.isTrueOrSet(String val) which would return true
> if toBoolean(val) || getProperty(val) != null.
PropertyHelper likely is the better place for this, otherwise I agree,
the code has to move out of Target and needs the described semantics.
Actually your toBoolean is not really boolean but follows a ternary
logic of true, false, "some other value including null". Maybe
something like
Boolean toBoolean(Object)
and you'd want
if toBoolean(val) == Booolean.TRUE ||
(toBoolean(val) != Boolean.FALSE && getProperty(val) != null)
so a value of "false" would really mean false.
The code in Target almost does that, with the exception that the
equivalent of toBoolean only works if val is a Boolean instance right
now.
> 3. Call iTOS from <target>, <fail>, etc. - anything with if/unless
> attributes with the standard meaning.
Sounds good.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]