--- On Fri, 9/25/09, Dominique Devienne <ddevienne@gmail.com> wrote:
> From: Dominique Devienne <ddevienne@gmail.com>
> Subject: Re: if/unless Attributes
> To: "Ant Developers List" <dev@ant.apache.org>
> Date: Friday, September 25, 2009, 9:31 AM
> On Fri, Sep 25, 2009 at 8:16 AM,
> Jesse Glick <jesse.glick@sun.com>
> wrote:
> > Refined proposal:
> >
> > 1. Make <target> evaluate if/unless attributes
> (just before deciding whether
> > or not to run the target).
> >
> > 2. Introduce Project.isTrueOrSet(String val) which
> would return true if
> > toBoolean(val) || getProperty(val) != null.
> >
> > 3. Call iTOS from <target>, <fail>, etc. -
> anything with if/unless
> > attributes with the standard meaning.
> >
> > Now <target if="doSomething"> would behave as
> before, for better or worse.
> > But you could also write <target
> if="${doSomething}"> and it would work as
> > most novice Ant users would expect: run the target if
> doSomething is defined
> > but also set to 'true' (or 'on' or 'yes'). Similarly
> for <fail> and friends.
>
> I like Jesse's proposal. It fits well with the principle of
> least
> surprise, on both
> the new user front, since ${foo} is correctly interpreted
> in boolean cases, and
> for existing users too, since the existing behavior of
> testing
> property existence
> remains. So +1 from me. Anything more is not really needed
> IMHO. --DD
I can certainly live with this. I am ambivalent. :)
-Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
|