ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Walden <>
Subject overriding targets that are extension-of an extension point
Date Mon, 28 Jul 2014 15:33:44 GMT
Hi Ant developers,

I am making use of target overriding in combination with extension-points.
I have the same problem as that discussed here, which will hit me when I upgrade to ant 1.9:

My use-case is identical to the one in Comment #3 of the above-mentioned issue:
- a common script with extension-points and default targets defined;
- a handful of project-specific build files which import these and override just a few targets.

The philosophy I am trying to follow here is where the common script defines the order of
execution of all build steps for all projects, thus achieving a certain degree of uniformity
across our build processes. I have taken an extreme approach
where any targets defined in the project-specific build files are only allowed
to specify the "extension-of" attribute, and not the "depends" attribute, thus forcing all
flow control logic to reside in the common script.

The workaround given in Comment #4 seems too messy/warty to me
... a lot of redundant targets have to be created:

...and the output is not very intuitive, as it suggests to the casual reader that
both "hi" and "hi-impl" were executed, which is not the case:
     [echo] Hello



So, if we leave this workaround to the side for the moment, my question is:
If a target from an common build file can be overridden by declaring a target of
the same name, why is this not also true for targets in the common build file that specify
an "extension-of" attribute?

In Comment #2 it was mentioned that the latter case is considered "dangerous",
but isn't overriding *any* target dangerous in that sense? As a script developer I would first
go and see what I am overriding, see what it depends on, see what it extends, etc.

Is it that the philosophy of removing flow control logic out of project-specific scripts
is not the Ant Way?

Many thanks for your consideration.

All emails in this message string and any attachments are the confidential information of
CSG Systems International, Inc. (CSG), or its affiliates and subsidiaries, and may contain
privileged and/or confidential material. If you are not an intended recipient, please delete
it immediately and notify the sender; unintended recipients are not authorized to read or
otherwise use the information contained herein.

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

View raw message