tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KB Sriram" <...@skytalk.com>
Subject javac task in ant: rework?
Date Sun, 28 Nov 1999 18:02:06 GMT
I'm wondering if we need an improved strategy to properly handle what the
javac task does to determine the list of files to recompile (i.e., instead
of using timestamp based out-of-date files.)

For example, in a "test" subdirectory I have two files, A.java and B.java

public class A implements B { public void m() {} }

public interface B { public void m(); }

For a build.xml that has this task:
<javac srcdir="test" destdir="build" classpath="lib/projectx-tr2.jar"
     debug="on" deprecation="on"/>

The first time I run ant, everything is ok.
----
build -buildfile test.xml -verbose
Buildfile: test.xml
Detected Java Version: 1.2
Project base dir set to: E:\Users\kbs\jakarta\jakarta-tools\ant
Setting project property: build.compiler to classic
 +Target: main
   +Task: mkdir
   +Task: javac
Executing Target: main
Compiling 2 source files to E:\Users\kbs\jakarta\jakarta-tools\ant\build
Using classic compiler
Compilation args: [-deprecation, -d,
E:\Users\kbs\jakarta\jakarta-tools\ant\build, -classpath,
E:\Users\kbs\jakarta\jakarta-tools\ant\build;E:\Users\kbs\jakarta\jakarta-to
ols\ant\lib\projectx-tr2.jar;..\ant.jar;..\projectx-tr2.jar;, -sourcepath,
E:\Users\kbs\jakarta\jakarta-tools\ant\test, -g]
Files to be compiled:
    E:\Users\kbs\jakarta\jakarta-tools\ant\test\A.java
    E:\Users\kbs\jakarta\jakarta-tools\ant\test\B.java

Completed in 1 seconds
----
If I change B.java to
public interface B { public void m2(); }

ant incorrectly creates a successful build, because it didn't select A for
recompilation.
----
build -buildfile test.xml -verbose
Buildfile: test.xml
Detected Java Version: 1.2
Project base dir set to: E:\Users\kbs\jakarta\jakarta-tools\ant
Setting project property: build.compiler to classic
 +Target: main
   +Task: mkdir
   +Task: javac
Executing Target: main
Compiling 1 source files to E:\Users\kbs\jakarta\jakarta-tools\ant\build
Using classic compiler
Compilation args: [-deprecation, -d,
E:\Users\kbs\jakarta\jakarta-tools\ant\build, -classpath,
E:\Users\kbs\jakarta\jakarta-tools\ant\build;E:\Users\kbs\jakarta\jakarta-to
ols\ant\lib\projectx-tr2.jar;..\ant.jar;..\projectx-tr2.jar;, -sourcepath,
E:\Users\kbs\jakarta\jakarta-tools\ant\test, -g]
Files to be compiled:
    E:\Users\kbs\jakarta\jakarta-tools\ant\test\B.java

Completed in 1 seconds
----

-kb-



Mime
View raw message