ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Sinclair" <j...@cooljeff.co.uk>
Subject Re: target-group in trunk
Date Thu, 10 Dec 2009 10:17:57 GMT
Hi Stefan,

We've implemented a common build template which other groups at the firm build upon. One issue
we have had is providing a simple way for our users to plug in custom logic without having
to copy Target definitions. We went about this by providing macro hooks which people could
override. For example if someone needed to do some custom code generation they could override
the pre-compile macro hook.

Would I be correct in thinking that target groups would be more suitable instead of the custom
macro hooks we have?

If so are there any examples of Target groups I could look at? I am particularly interested
in how I control whether or not my contributed Target is put at the beginning or end of a
Target group.

In terms of support for if/unless, this could be useful for common build templates such as
ours. For example we may have some logic to build a web component that should not be invoked
if the project is not a web project.

Will it be possible to contribute to target groups programmatically too? 

How do Target groups and their targets contribute to the -p option?

Jeff

----- Reply message -----
From: "Stefan Bodewig" <bodewig@apache.org>
Date: Thu, Dec 10, 2009 05:11
Subject: target-group in trunk
To: <dev@ant.apache.org>

Hi,

this is just a description of what target-group in trunk currently is
and what it is not.  I'll describe the implementation rather than the
initial phase concept as it is implemented in EasyAnt which uses a
custom ProjectHelper to implement its slightly different concept.

This mail serves as background in addition to the thread Nicolas has
started.

A target-group is basically a target with two differences:

* must be empty

* its depends list can be added to during parse time.  Other targets and
  target-groups can declare themselves as part of the group and get
  added to the group's depends list.

That's all.  Order of execution is still only determined by the depends
attributes of all targets.

For anybody running a build target-groups are just like targets.  They
are listed together with targets in -projecthelp and create BuildEvents
and log output of targets.

A target-group is not a container of targets.  It doesn't provide a
grouping in a sense that a target would be executed as part of a group -
the depends lists of all targets and target-groups still determine the
order.

Since a target-group is always empty, the if and unless attributes don't
have any effect at all.

Of course we could change the implementation to get to a more
composite-like implementation - making if and unless useful and maybe
introduce new build events - it is just not clear (to me) whether the
additional effort would provide anything more useful.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message