ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Bitting <>
Subject RE: javac always recompiles all files
Date Mon, 22 Jan 2001 23:35:33 GMT


    <target name="compile" depends="prepare">
       <javac srcdir="com" destdir="${build.dir}/classes" debug="on"
          deprecation="off" optimize="off"/>


    <target name="compile" depends="prepare">
       <javac destdir="${build.dir}/classes" debug="on"
          deprecation="off" optimize="off"

By setting 'srcdir="com"', you are telling javac that package names should be resolved relative
to "com", which is probably not what you want.
Instead specify 'includes="com"' to tell the javac task to look within the 'com' directory
for source files.

For example, assume you have a file located at "com/foo/", with a package declaration
of "package".  When is compiled, the
compiler will place it within the '' package.  However, according to your build.xml,
when the javac task does its dependency sweep, it will be
looking for 'bar' within the package 'foo' (not '').  Not finding it, the javac task
will think it needs to be recompiled.

Wow, that explanation sure looks overly complicated to me.  I hope you can make sense of it!


View raw message