ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Oxspring" <roxspr...@imapmail.org>
Subject Re: ant bug or user error?
Date Wed, 27 Mar 2002 12:06:38 GMT

----- Original Message -----
From: "Jose Alberto Fernandez" <j_a_fernandez@yahoo.com>
To: "Ant Developers List" <ant-dev@jakarta.apache.org>
Sent: Wednesday, March 27, 2002 11:28 AM
Subject: Re: ant bug or user error?


> --- Stefan Bodewig <bodewig@apache.org> wrote: > On
> Tue, 26 Mar 2002, Paul Kilroy
> > <paulkilroy@yahoo.com> wrote:
> >
> > > I think the is related to the fact that ant caches
> > > targets (and their tasks), but the task is
> > "cleaned
> > > up" at the end of the execute method. This pretty
> > much
> > > invalidates the cache for the target.
> >
> > Yes.
> >
>
> I just hit this problem myself, when trying to
> force some different evaluation order of the targets.
>
> This is really a bad bug.
>
> > > -Don't run the target again, it's already been
> > run.
> >
> > or alternatively, don't use cached tasks.
> >
> > We've always said that "ant foo moo" is supposed to
> > be the same as
> > "ant foo; ant moo" which it obviously is not.
> >
>
> The problem here is that properties and IDs will be
> reevaluated and I am not sure what that would do for
> backward compatibility.
>
> What I would like to do is to add a new command-line
> option (and acompaning magic property) called "-once"
> what this would do is treat the list of targets in the
> command line as follows:
>
>   ant -once t1 t2 t3 t4
>
> executes a synthetic target "-once" defined as:
>
>   <target name="-once" depends="t1, t2, t3, t4"/>

It would be a start but its restrictive, what when people want to mix and
match behaviours?  Why not let the user simply supply commas on the
commandline when the targets should be coellesced into a target dependancy -
I think this should be fairly intuitive to buildfile writers. Ultimately a
translation along the lines of the following would take place:

ant    t1,t2    ,t3,     t4 => depends="t1,t2,t3,t4"

While the following would translate into two targets with depends="t1,t2"
and depends="t3,t4" respectively:
ant    t1,t2    t3,t4

There are no usecases that spring to mind off hand (mainly because any
regular invocation of t1,t2 should probably be named and described as a
first class target IMO) but I'm sure they will become apparent as people are
used to the current setup and make use of the side effects.

Of course, allowing this would mean using multiple target names, although a
hardcoded name of "-once" would be a bad idea anyway IMHO because sooner or
later someone may want it for an actual target name (or are things like an
initial '-' being validated already?).

Rob

>
> this should be quite easy to do, I think, and would
> solve this issue to those who need it. The same
> behaviour should work for:
>
>   <ant target="t1, t2, t3" ... />
>
> which would be a nice enhancement for this task.
>
> Thoughts?
>
> Jose Alberto
>
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
>
>


--
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