ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Dawson <>
Subject RE: top level tags in ant vs. "init" task as an attribute of proj ect
Date Wed, 10 Oct 2001 13:10:39 GMT
> 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.


<project name="foo" init="startup" default="all">

  <target name="startup">
    <!-- no new magic here... -->

  <target name="all">
    <!-- no current magic here... -->



> -----Original Message-----
> From: Peter Donald []
> Sent: Friday, October 05, 2001 12:23 PM
> To:
> Subject: Re: top level tags in ant vs. "init" task as an attribute of
> project
> On Sat, 6 Oct 2001 02:09, Tim Dawson wrote:
> > What I'd like to recommend is for those elements to need to 
> be defined
> > inside a target, and to add to the <project> tag an "init" 
> attribute to
> > complement the "default" attribute. Whereas "default" is 
> the default target
> > to execute if one is not defined, "init" would be a target 
> to execute once
> > before doing anything.
> >
> > I know that my code is littered with depends="init" on 
> almost all targets,
> > even though most of the time its unnecessary since init has already
> > executed due to a previous dependency. I'd like to only 
> have it where
> > necessary, but its hard to keep track. It sure would be 
> nice to be able to
> > remove those, and it would also be nice to have the 
> consistency of having
> > everything inside <project> be a <target>.
> This was actually the case at one time and a whole bunch of ant-dev 
> committers agreed that it was the "right thing to do" at the 
> time. However 
> subsequently a whole bunch of users complained and quite a 
> few ant-dev 
> comiitters don't like notion of "magic" names for tasks.
> -- 
> Cheers,
> Pete
> ---------------------------------------------------
> "Therefore it can be said that victorious warriors 
> win first, and then go to battle, while defeated 
> warriors go to battle first, and then seek to win." 
>               - Sun Tzu, the Art Of War
> ---------------------------------------------------

View raw message