--- On Thu, 9/24/09, Stefan Bodewig <bode...@apache.org> wrote:

> From: Stefan Bodewig <bode...@apache.org>
> Subject: Re: if/unless Attributes
> To: dev@ant.apache.org
> Date: Thursday, September 24, 2009, 10:42 AM
> On 2009-09-24, Dominique Devienne
> <ddevie...@gmail.com>
> wrote:
> 
> > On Thu, Sep 24, 2009 at 6:32 AM, Stefan Bodewig <bode...@apache.org>
> wrote:
> >> the if/unless attributes for target have changes
> slightly in that they
> >> now may use PropertyHelpers.  I.e.
> 
> >> <target if="${foo}">
> 
> >> will not be executed if ${foo} happens to expand
> to a Boolean instance
> >> with a booleanValue() of "false" and likewise
> 
> >> <target unless="${foo}">
> 
> >> will be executed in that case.  So far this
> hasn't been documented, but
> >> I'll do so shortly.
> 
> > That's a pretty big change.
> 
> As is the changed PropertyHelper API.  In fact Matt
> added that more or
> less at the same time.  I just stumbled over it while
> trying to
> understand PropertyHelper 8-)
> 
> > What's the exact semantic? Does it depend on the type
> returned, like
> > Boolean, Object, String.
> 
> Yes, it only applies to Boolean.
> 
> > For String, does that fall back to assuming it's a
> property name that
> > must be checked for existence?
> 
> the logic in target is:
> 
> * try to evaluate the argument (${foo}) as a property 
> 
> * if the result is a Boolean, use its booleanValue
> 
> * if it is not a Boolean, ignore it completely but instead
> check whether
>   a property of the argument's name exists - just like
> in Ant 1.7.1 this
>   does not expand ${foo} so it would look literally
> look up a property
>   named ${foo}.
> 
> > What's the exact timing of the evaluation? Before or
> after depends' targets?
> 
> The same as before - at the start of Target#execute, i.e.
> it doesn't
> factor into depends at all.
> 

I'm discreet that way.  ;)

-Matt

> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
> For additional commands, e-mail: dev-h...@ant.apache.org
> 
> 




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

Reply via email to