You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Ja...@rzf.fin-nrw.de on 2010/08/17 05:49:53 UTC

ExtensionPoints + Dependencies

If I have a buildfile with extension points and their extensions, I
think I would be able to run the extensions as part of the whole build
via extension-points and directly. But if I run the target directly I
would think, that dependencies are also executed, but they are not.

Is this forgotten or am I wrong?


Jan

<project default="C">
    <echo>Ant-Version ${ant.version}</echo>
    <target name="A"/>
    <extension-point name="B" depends="A"/>
    <target name="C" extensionOf="B"/>
</project>

C:\TEMP\ant-test>ant
Buildfile: C:\TEMP\ant-test\build.xml
     [echo] Ant-Version Apache Ant version 1.8.1 compiled on April 30
2010

C:

BUILD SUCCESSFUL
Total time: 1 second
C:\TEMP\ant-test>ant B
Buildfile: C:\TEMP\ant-test\build.xml
     [echo] Ant-Version Apache Ant version 1.8.1 compiled on April 30
2010

A:

C:

B:

BUILD SUCCESSFUL
Total time: 0 seconds

AW: ExtensionPoints + Dependencies

Posted by Ja...@rzf.fin-nrw.de.
>IMHO you are wrong.  extensionOf adds C to the depends list of 
>B but doesn't change anything for C itself.

So my target has to define the dependencies for itself.

I changed the names to more meaningful ones:


<project default="build">
    <echo>Ant-Version ${ant.version}</echo>

    <target name="init-ivy">
        <echo>Initialize Ivy (download ivy.jar, taskdef ...)</echo>
    </target>

    <extension-point name="metrics" depends="init-ivy"/>

    <target name="build" depends="metrics">
        <echo>Full Build</echo>
    </target>

    <!--
    Have to define the dependency so you could run this target
    directly from command line, outside of a "full build"
    -->
    <target name="checkstyle" extensionOf="metrics" depends="init-ivy">
        <echo>Ivy-Cachepath for downloading CS, taskdef it</echo>
        <echo>Running Checkstyle...</echo>
    </target>
</project>


Jan

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


Re: ExtensionPoints + Dependencies

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-17, <Ja...@rzf.fin-nrw.de> wrote:

> If I have a buildfile with extension points and their extensions, I
> think I would be able to run the extensions as part of the whole build
> via extension-points and directly. But if I run the target directly I
> would think, that dependencies are also executed, but they are not.

I really needed your example to understand what you are after 8-)

> <project default="C">
>     <echo>Ant-Version ${ant.version}</echo>
>     <target name="A"/>
>     <extension-point name="B" depends="A"/>
>     <target name="C" extensionOf="B"/>
> </project>

You expect Ant to execute A if you ask it to execute C, right?

> Is this forgotten or am I wrong?

IMHO you are wrong.  extensionOf adds C to the depends list of B but
doesn't change anything for C itself.

Stefan

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