ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Raible <matt_rai...@yahoo.com>
Subject Javac re-compiles classes that haven't changed
Date Wed, 04 Feb 2004 21:14:55 GMT
I have the following compile target that compiles some .java files in the
src/service tree, as well as some XDoclet generated files (Struts ActionForms)
in build/web/gen.  The problem I'm experiencing is that the files from
build/web/gen are recompiled every time, even if they haven't been regenerated.
 Any ideas how to solve this?

    <target name="compile-service" depends="package-dao" 
    	description="Compile service module">
        <antcall target="compile-module" inheritAll="true">
            <param name="module" value="service"/>
            <!-- Needed for generated ActionForms -->
            <param name="additional.src.dirs"
                value="${build.dir}/web/gen;src/web/org/appfuse/webapp/form"/>
            <reference refid="service.compile.classpath"
                torefid="compile.classpath"/>
            <reference refid="service.test.classpath"
                torefid="test.classpath"/>
        </antcall>
    </target>

    <target name="compile-module">
        <!-- Inputs: module, compile.classpath, test.classpath -->
        <echo level="info">Compiling ${module}...</echo>
        <mkdir dir="${build.dir}/${module}"/>
        <mkdir dir="${build.dir}/${module}/classes"/>
        <mkdir dir="${test.dir}/${module}"/>
        <mkdir dir="${test.dir}/${module}/classes"/>
        <property name="additional.src.dirs" value=""/>
        <javac srcdir="src/${module};${additional.src.dirs}"
            destdir="${build.dir}/${module}/classes"
            debug="${compile.debug}"
            deprecation="${compile.deprecation}"
            optimize="${compile.optimize}"
            classpathref="compile.classpath"
            />
        <javac srcdir="test/${module}"
            destdir="${test.dir}/${module}/classes"
            debug="true">
            <classpath>
                <path refid="test.classpath"/>
                <path location="${build.dir}/${module}/classes"/>
            </classpath>
        </javac>
    </target> 

Thanks,

Matt


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


Mime
View raw message