You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2001/07/23 22:31:30 UTC
[Bug 2736] - Ant javac task has problems with dependencies
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2736
*** shadow/2736 Mon Jul 23 04:15:24 2001
--- shadow/2736.tmp.9973 Mon Jul 23 13:31:30 2001
***************
*** 2,9 ****
| Ant javac task has problems with dependencies |
+----------------------------------------------------------------------------+
| Bug #: 2736 Product: Ant |
! | Status: NEW Version: Nightly build |
! | Resolution: Platform: All |
| Severity: Major OS/Version: All |
| Priority: Other Component: Core tasks |
+----------------------------------------------------------------------------+
--- 2,9 ----
| Ant javac task has problems with dependencies |
+----------------------------------------------------------------------------+
| Bug #: 2736 Product: Ant |
! | Status: RESOLVED Version: Nightly build |
! | Resolution: WORKSFORME Platform: All |
| Severity: Major OS/Version: All |
| Priority: Other Component: Core tasks |
+----------------------------------------------------------------------------+
***************
*** 167,170 ****
the depend flag was also used in the build.xml file (see above)
Best regards,
! Peter Van der Goten
--- 167,228 ----
the depend flag was also used in the build.xml file (see above)
Best regards,
! Peter Van der Goten
!
! ------- Additional Comments From nico@apache.org 2001-07-23 13:31 -------
! See the description for tha javac task:
!
! "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.
!
! Note: Ant uses only the names of the source and class files to find the classes
! that need a rebuild. It will not scan the source and therefor will have no
! knowledge about nested classes, classes that are named different from the
! source file and so on."
!
! If you call jikes and pass only the names of the files that are out of date -
! depend will not help you:
!
! "C:\temp\bug2736>type src\be\alcatel\test\TestConstsITF.java
! package be.alcatel.test;
!
! public interface TestConstsITF{
! public static final int const1 = 11;
! }
!
! C:\temp\bug2736>jikes -depend -sourcepath %SRCDIR% -classpath .;%CLASSDIR%;c:\jd
! k131\jre\lib\rt.jar -d %CLASSDIR% %SRCDIR%\be\alcatel\test\TestConstsITF.java
!
! C:\temp\bug2736>java -cp classes be.alcatel.test.Test
! TestConstsITF.const1 = 10
! const1 = 10
! AnOtherTestConstsITF.const2 = 10
! const2 = 10"
!
! Possible Solutions include:
!
! - Modify Ant to always pass all java-files it finds to the compiler (results in
! recompile everything)
! - Delete the target files before compiling (results in recompile everything)
! - Use the depend-task (find dependencies, delete files which should be
! recompiled although they are up-to-date (from a file-time perspective) and use
! javac to compile only missing/old files)
!
! This:
!
! <?xml version="1.0"?>
! <project default="main">
! <target name="main">
! <depend srcdir="src"
! destdir="classes"
! closure="true"/>
! <javac srcdir="src"
! destdir="classes"/>
! </target>
! </project>
!
! should work for you.
!
! Nothing we can fix here, we could just slowdown ant. You are invited to come to
! ant-user if you have further questions regarding the proposed solution.