ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cmanola...@yahoo.com>
Subject Re: PROPOSAL: top level execution order
Date Thu, 28 Nov 2002 00:46:03 GMT
Stefan Bodewig wrote:

> On Wed, 27 Nov 2002, Costin Manolache <cmanolache@yahoo.com> wrote:
>> Stefan Bodewig wrote:
>> 
>>> Another downside of the HEAD version: As I pointed out last week,
>>> the way CVS HEAD works breaks backwards compatibilty in a subtle
>>> way because <taskdef>s will no longer be executed before the task
>>> definitions are encountered by the parser right now.
>> 
>> That's an upside IMO :-)
>> 
>> It will lead to more consistent behavior ( especially if combined
>> with the generalised lazy eval ).
> 
> Quite the opposite - see Conor's example of replacing echo with jar.
> It works in 1.5.1 and doesn't in CVS HEAD.  If you put the taskdef
> into a target, only the first <echo> is going to work, but not the
> second (in both Ants).

I think we're talking about different things.

AFAIK the <echo> example would work with the current embed - all 
tasks are created in a consistent way ( allways lazy ). The real 
problem was that echo was instantiated before the taskdef was executed
( in MAIN and also in embed, before making all tasks lazy ).


> So yes, CVS HEAD is more consistent that it breaks in both situations,
> but it shouldn't break at all (or at least be consistent in not
> allowing the no-child version of echo either).

I'll try it with embed, but I'm relatively sure it will work. 


> 
>> If something relies on taskdef beeing executed imediately, then it's
>> a bug
> 
> good bye replacement of built-in tasks ...

Not so. Relying on taskdef beeing executed _before_ the task is reasonable
and can be supported. 

Even in ant1.5, taskdefs at target level are not executed imediately 
but are executed _before_ the task. 

In embed takdefs are allways executed before the task - but never imediately 
( for top level and target level - same behavior ).


>> since we have no guarantee on that
> 
> "It's always been that way since <taskdef> has been introduced"
> doesn't count?

I think both ant1.4 and ant1.5 will not execute taskdefs in targets.

And I'm not sure what's the exect change in behavior - as long as taskdef
is executed before instantiating the task.



>>> And when the parser detects an error after some of the tasks have
>>> been run ...
>> 
>> Parser ( XML ) errors will be detected in the same way in the main
>> build file.
> 
> I was talking about the project file parser, not the XML parser.
> Things like <target> nested into <target>.

I don't think this is a major issue - in ant1.5 there are a lot 
of errors that are detected at runtime, after some of the build file
has been executed.

Costin



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