ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Dawson <>
Subject top level tags in ant vs. "init" task as an attribute of project
Date Fri, 05 Oct 2001 16:09:13 GMT
Currently, Ant allows a handful of tags, such as <property>, <path>, and
<taskdef>, to live at the top level inside the <project> tag, instead of
needing to be nested inside <target> tasks.

This seems to conflict with the design style of Ant & needing to wrap
everything inside more and more targets. :-)

Its also inconsistent because its not entirely clear what tasks can live
outside a target and which ones must live inside. (or I must not have read
that section in the online docs).

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


View raw message