ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: <init>/<finally> and top-level tasks (was RE: Problems with < impo rt>)
Date Sat, 20 Jul 2002 19:42:51 GMT
OK, then, we just have to convince actual committers I guess ;-) --DD

-----Original Message-----
From: Nicola Ken Barozzi []
Sent: Saturday, July 20, 2002 2:34 PM
To: Ant Developers List
Subject: Re: <init>/<finally> and top-level tasks (was RE: Problems with
<impo rt>)

Dominique Devienne wrote:
> OK, then. I can agree with that.
> Question #1:
> How many times do <init> and <finally> run when I do:
> ant -builldfile antx build doSomething
> If you had build and doSomething both depend on an init target, init would
> be run twice. With a special <init> element, how many times does it run?

It should be run as having depends="init" on all targets, ie run twice.

> Question #2:
> How does <init> relates to top-level elements like
> <property>/<path>/taskdef/...?
> Does it run before? after?
> having top-level tasks allowed gives you an implicit <init>!ù

That's why I proposed to deprecate them.

> Personnally, I think having an explicit <init> that contains tasks is
> that having top-level tasks. Has Stéphane B. wrote, you can't wrote code
> outside methods in Java, so why allow tasks outside of targets. ù


> You can have
> data outside of methods though, which is why we have data types outside
> targets. We should keep it that way.

I was improperly saying "deprecating", since global top-level tasks were 
not enabled in 1.5.

+1 as you say.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message