You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by John Festa <ka...@bellatlantic.net> on 2000/12/10 16:45:52 UTC

failure to re-build dependent targets ??

I'm a novice Ant user, so thanks in advance for your patience if I'm missing
something obvious here.

In this example, the build file, Java sources, and Java class files all
reside in the same directory. Both Java classes are members of the 'global'
Java package. If I modify 'CallMe.java' -- for example, change a method
signature, and then run 'ant Caller.class', Ant properly detects the change
to 'CallMe.java' and rebuilds it, but does *not* rebuild 'Caller.class'
which depends on it. Is this expected behavior or am I doing something
wrong?

<project    name="AntTest" default="Caller.class" basedir="." >

    <target name="CallMe.class" depends="CallMe.java" >
        <javac  srcdir="${basedir}" destdir="${basedir}"
classpath="${basedir}" >
            <include name="CallMe.java" />
        </javac>
    </target>

    <target name="Caller.class" depends="Caller.java,CallMe.class" >
        <javac  srcdir="${basedir}" destdir="${basedir}"
classpath="${basedir}" >
            <include name="Caller.java" />
        </javac>
    </target>

    <target name="CallMe.java" />
    <target name="Caller.java" />
</project>