Alex Rivera | Logout

Why does ant compile all classes each run?

Asked 2009-05-06T01:06:12.487
10

I'm more accustomed to make, so I'm confused why ant recompiles classes when the source hasn't been changed. I've read that there is a requirement to recompile in some cases where generics are used, but I'm not sure that this will be necessary for my project.

Also, in the javac task, I've set includeDestClasses="true"

Here's some of the targets I'm using

<target name="init">
        <mkdir dir="${build}"/>
        <mkdir dir="${dist}"/>
    </target>
    <target name="compile" depends="init,util,semantics" description=""/>
    <target name="util" depends="" description="">
        <javac destdir="${build}" classpath="project.class.path" debug="on" srcdir="${src}/util" includeDestClasses="true" source="1.5">
            <classpath refid="project.class.path"/>
        </javac>
    </target>
Edit
Report

1 Answer

8

Your src & dest directories are not equivalent, so ant is not able to effectively stat the output files to compare them.

This is an FAQ: http://ant.apache.org/faq.html#always-recompiles

answered 2009-05-06T02:11:08.773

Your Answer