ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tuft Muller" <...@online.no>
Subject RE: Ant 1.4.1: Javac task compiling source despite non-altered source files
Date Wed, 14 Nov 2001 09:16:44 GMT
| If your source directory structure does not correspond to the package
| structure, then the classes will be recompiled every time.  For example,
| if your class is org.foo.mypack.Class, then your source must be in
| srcdir/org/foo/mypack/Class.java.

You are right. But please note the following:

I do indeed have the source files in the proper file structure
(corresponding to the package structure). Interestingly this happened after
I re-orgianized the sourcecode, and upgraded Ant from 1.3 to 1.4.1. One of
the major differences regarding sourcecode organization is that I now have
the sourcecode under <project-home>/src/main and <project-home>/src/test.
Packages under 'main' is com.onrelay.*. Packages under 'test' is
test.onrelay.* e.g.
.../JUtils/src/main/com/onrelay/collections/SingleLinkedList.java and
.../JUtils/src/test/test/onrelay/collections/SingleLinkedListJUnitTest.java

Now, my javac task is instructed to compile everything below .../JUtils/src,
and with this setting it won't appreciate that classes in the target
directory is newer than the sourcefiles. However, if I use nested <src>
instead of 'srcdir' then everything works fine.

I consider this a bug in Ant.

Thanx a lot for your valuable help!

--

Thomas




|
| Thomas Tuft Muller wrote:
|
| >Hi,
| >
| >>From the Javac task documentation:
| >
| >"The source and destination directory will be recursively
| scanned for Java
| >source files to compile. Only Java files that have no corresponding class
| >file or where the class file is older than the java file will be
| compiled."
| >
| >My javac task(s) recompile(s) the full source *every single*
| time I run the
| >project file irrespective of the class files exist in the build
| directory or
| >not, and irrespective whether the source-files have been altered.
| >
| >Extract from one of the project files:
| >
| ><target name="compile" depends="prepare">
| >		<javac destdir="${build.classes}"
| >			srcdir="${src.dir}"
| >			debug="${java.compiler.debug}"
| >			deprecation="${java.compiler.deprecation}"
| >			optimize="${java.compiler.optimize}">
| >			<classpath refid="classpath"/>
| >		</javac>
| ></target>
| >
| >Ant version: Ant version 1.4.1 compiled on November 12 2001
| >OS: Win2k, service pack 2
| >
| >Any ideas why?
| >
| >--
| >
| >Thomas
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >*************************************************************************
| >Copyright ERA Technology Ltd. 2001. (www.era.co.uk). All rights
| reserved.
| >Confidential. No liability whatsoever is accepted for any loss or damage
| >suffered as a result of accessing this message or any attachments.
| >
| >--
| >To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>
>

--
Furthermore, I believe bacon prevents hair loss.

Peter Davis
Developer, Speaklink Inc.
peter@speaklink.com




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


Mime
View raw message