ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56337] Extension point target rewriting
Date Thu, 03 Apr 2014 11:37:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56337

--- Comment #3 from rich@steelezone.net ---
My use case:

Imagine a java.xml that, among many other things, hooks into a compile
extension point:

<project name="java">
        <import file="compile.xml" />
    <target name="java:compile" extensionOf="compile">
        <javac ... />
    </target>
        .
        .
        .
</project>

from compile.xml:

<project name="compile">
    <extension-point name="compile" />
</project>

Most projects would find using the default implementation of the java:compile
target provided by the compile extension point, but sometimes we'd like to
override its behavior:

<project name="build">
    <import file="java.xml" />
    <target name="java:compile">
        <javac ... />
    </target>
</project>

This is usually needed when the default implementation doesn't do what is
needed by this particular build and the generic scripts aren't quite flexible
enough.

While I do see the logic of the change: while I overrode the target--calling
the java:compile target directly does work--the extension point is preserving
its dependencies like regular dependencies do, I'm a little stuck.  Without the
override, how would I allow a build script author to do what they need without
resorting to copying and pasting the entirety of the original java.xml?  (It
does more than just compile: javadoc, zipping up the source, etc.)  I'm failing
to see how <bindtargets> helps in this case...unless I ditched using
extensionOf entirely, using <bindtargets> with unless:true attributes and a
while bunch of properties for each?  That seems complicated and error prone.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message