You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Erik Hatcher <ja...@ehatchersolutions.com> on 2001/10/01 02:42:09 UTC

Re: [PATCH] Script enhancement to standardize the "project" object exposed

Just a couple of quick comments:

- 'this' does not work as that is a pre-defined BSF name, 'this' contains
members of all the objects that Script.java places within its context (so it
will contain 'self', and all the other references and properties that have
legal Java identifiers).  'self' is the name I've submitted.

- Thanks for the example where the Task reference comes in handy.

    Erik

----- Original Message -----
From: "Phil Surette" <ph...@home.com>
To: <an...@jakarta.apache.org>
Sent: Sunday, September 30, 2001 4:47 PM
Subject: Re: [PATCH] Script enhancement to standardize the "project" object
exposed


> Wow! Step away from my computer for a couple of days and I see
> my suggestion has borne strange fruit!
>
> I'm new to this list so I guess my vote doesn't count, but I'd
> give a +1 to the 'self' addition if I could... though I think
> Erik said that 'self' did not work. I prefer 'script' to
> 'thisScript' since long, verbose names are not very
> scripty.
>
> The addition of 'project' is a great improvement over the
> current state of affairs. I'm glad that got through.
> Ideally I'd like to see 'project' and 'this' both, since
> it is the 'project' object you will be working with most of
> the time, and once again having to type script.project
> all over the place is not very scripty.
>
> I don't think backward compatibility of scripts is a huge
> issue. Scripts will be as backward compatible as regular
> tasks. If you don't want people creating dependencies
> on the Ant API, you shouldn't publish the API in the
> distribution ;)
>
> Finally, here's a possible valid reason why scripts should be able
> to access their task (easily, since they can do it awkwardly already):
> BuildExceptions. When a script wants to throw a BuildException,
> it should be using the BuildException constructor that
> takes a Task argument.
>