You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Matt Raible <ma...@raibledesigns.com> on 2004/02/04 18:30:18 UTC
[repost] Javac re-compiles classes that haven't changed
I sent this on Monday, but it never showed up on the list.
---
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org