ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: top level tags in ant vs. "init" task as an attribute of proj ect
Date Wed, 10 Oct 2001 14:22:58 GMT
Tim Dawson wrote:

>>comiitters don't like notion of "magic" names for tasks.
> ... and I would have been one of them!  Keeping things clear and
> straightforward should be the defualt, and "magic" names certainly wouldn't
> provide that.  This is also why I don't like the ability to put things other
> than targets directly under project -- its not clear at all which tasks are
> allowed at the top level, and which aren't... until you try.
> But I don't think allowing an init target has anything to do with "magic"
> names...  If the project element allowed an "init" attribute, then the
> target name wouldn't be magic; at least no more than the default target is.
> e.g.
> <project name="foo" init="startup" default="all">
>   <target name="startup">
>     <!-- no new magic here... -->
>   </target>
>   <target name="all">
>     <!-- no current magic here... -->
>   </target>
> </project>
> Tim

This is better than the original approach that a target named "init" was 
special. However, it still leaves some open questions

What if I write

<target name="startup" depends="all">

Will "all" be run first or will "startup" or will it fail as a circular 
dependency? An alternative would be to create an <init> element which 
functions like a target but which has no depends list. What I originally 
objected to was behaviour tied to special names. If the behaviour comes 
from the structure, it isn't really a problem for me, although it could 
be argued that it makes dependency definition less explicit.


View raw message