Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.3.1
-
None
-
None
Description
If a java file is in default package, buildr will recompile it only if it changes. If a java file is in a named package, buildr will recompile it everytime, even when unecessary.
= Example 1 (default package) =
File src/main/java/Hello.java
<buildfile>
define 'buildr_nopackage' do
project.version = '1.0'
package(:jar)
end
</buildfile>
$ buildr compile
(in /home/lacton/workspace/buildr_nopackage, development)
Compiling buildr_nopackage
Compiling buildr_nopackage
Completed in 0.715s
$ buildr compile --trace
(in /home/lacton/workspace/buildr_nopackage, development)
-
- Invoke buildr:initialize (first_time)
- Execute buildr:initialize
- Invoke buildr_nopackage (first_time)
- Execute buildr_nopackage
- Invoke /home/lacton/workspace/buildr_nopackage/lib/scala-library.jar (first_time)
- Execute /home/lacton/workspace/buildr_nopackage/lib/scala-library.jar
- Invoke /home/lacton/workspace/buildr_nopackage/lib/scala-compiler.jar (first_time)
- Execute /home/lacton/workspace/buildr_nopackage/lib/scala-compiler.jar
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar (first_time, not_needed)
- Invoke /var/lib/gems/1.8/gems/buildr-1.3.1.1/lib/buildr/java (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant-trax/1.7.0/ant-trax-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant-junit/1.7.0/ant-junit-1.7.0.jar (first_time, not_needed)
- Invoke /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar (first_time, not_needed)
- Invoke buildr_nopackage
- Invoke compile (first_time)
- Execute compile
- Invoke buildr_nopackage
- Invoke buildr_nopackage
Compiling buildr_nopackage - Invoke buildr_nopackage:compile (first_time, not_needed)
- Invoke buildr_nopackage:resources (first_time)
- Execute buildr_nopackage:resources
- Invoke /home/lacton/workspace/buildr_nopackage/src/main/java (first_time, not_needed)
Completed in 0.095s
There is no compilation at all on the second call, as expected.
= Example 2 (named package) =
File src/main/java/mypackage/Hello.java
<buildfile>
define 'buildr_package' do
project.version = '1.0'
package(:jar)
end
</buildfile>
$ buildr compile
(in /home/lacton/workspace/buildr_package, development)
Compiling buildr_package
Compiling buildr_package
Completed in 0.664s
$ buildr compile --trace
(in /home/lacton/workspace/buildr_package, development)
-
- Invoke buildr:initialize (first_time)
- Execute buildr:initialize
- Invoke buildr_package (first_time)
- Execute buildr_package
- Invoke /home/lacton/workspace/buildr_package/lib/scala-library.jar (first_time)
- Execute /home/lacton/workspace/buildr_package/lib/scala-library.jar
- Invoke /home/lacton/workspace/buildr_package/lib/scala-compiler.jar (first_time)
- Execute /home/lacton/workspace/buildr_package/lib/scala-compiler.jar
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar (first_time, not_needed)
- Invoke /var/lib/gems/1.8/gems/buildr-1.3.1.1/lib/buildr/java (first_time, not_needed)
[parsing started /home/lacton/workspace/buildr_package/src/main/java/mypackage/Hello.java]
[parsing completed 37ms]
[search path for source files: [/home/lacton/workspace/buildr_package/src/main/java]]
[search path for class files: [/usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/rt.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/jsse.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/jce.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/charsets.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/ext/localedata.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/ext/sunjce_provider.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/ext/dnsns.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/ext/sunpkcs11.jar, /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar]]
[loading /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/rt.jar(java/lang/Object.class)]
[loading /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/rt.jar(java/lang/String.class)]
[checking mypackage.Hello]
[wrote /home/lacton/workspace/buildr_package/target/classes/mypackage/Hello.class]
[total 340ms] - Invoke /home/lacton/.m2/repository/org/apache/ant/ant-trax/1.7.0/ant-trax-1.7.0.jar (first_time, not_needed)
- Invoke /home/lacton/.m2/repository/org/apache/ant/ant-junit/1.7.0/ant-junit-1.7.0.jar (first_time, not_needed)
- Invoke /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar (first_time, not_needed)
- Invoke buildr_package
- Invoke compile (first_time)
- Execute compile
- Invoke buildr_package
- Invoke buildr_package
Compiling buildr_package - Invoke buildr_package:compile (first_time)
- Invoke buildr_package:resources (first_time)
- Execute buildr_package:resources
- Invoke /home/lacton/workspace/buildr_package/src/main/java (first_time, not_needed)
- Execute buildr_package:compile
Compiling buildr_package
javac -classpath /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar -sourcepath /home/lacton/workspace/buildr_package/src/main/java -d /home/lacton/workspace/buildr_package/target/classes -verbose -g /home/lacton/workspace/buildr_package/src/main/java/mypackage/Hello.java
Completed in 0.744s
Hello.java was recompiled and the file target/classes/mypackage/Hello.class was written once more, with a new timestamp, although nothing changed between the two compilation.