1. fresh download from
http://downloads.typesafe.com/scalaide-pack/3.0.2.vfinal-210-20131028/scala-SDK-3.0.2-vfinal-2.10-macosx.cocoa.x86_64.zip
2. created a new java project, add scala nature (and make sure scalabuilder replaced javabuilder after this)
3. create A.java public class A {}
4. create B.java public class B {}
5. in java build path -> libraries -> add external class folder -> add any folder, empty is fine
6. update A.java, e.g. adding some space and line breaks
7. observe the last modified timestamp of A.class and B.class
8. they both get updated.
see attached workspace and scalaide compiler log file
not sure if this is a bug of eclipse, sbt or scalaide.
Many Thanks,
Tong
http://downloads.typesafe.com/scalaide-pack/3.0.2.vfinal-210-20131028/scala-SDK-3.0.2-vfinal-2.10-macosx.cocoa.x86_64.zip
2. created a new java project, add scala nature (and make sure scalabuilder replaced javabuilder after this)
3. create A.java public class A {}
4. create B.java public class B {}
5. in java build path -> libraries -> add external class folder -> add any folder, empty is fine
6. update A.java, e.g. adding some space and line breaks
7. observe the last modified timestamp of A.class and B.class
8. they both get updated.
see attached workspace and scalaide compiler log file
not sure if this is a bug of eclipse, sbt or scalaide.
Many Thanks,
Tong
Leave a comment
file:dtaOnWwAir44k5acwqjQYw
scalaide workspace and compiler log
scalaide workspace and compiler log
on 2013-12-03 19:01 *
By bartvangeneugden
Retried repro-steps and the issue occurs here as well.
All class files get recompiled when saving a .java file
All class files get recompiled when saving a .java file
on 2013-12-04 13:52 *
By Iulian Dragos
I'll have a look. Sounds bad enough.
on 2013-12-04 13:56 *
By Iulian Dragos
Actually, I have to take it back: we're using Sbt to drive the build, and the incremental compiler for Java is not as advanced as the Eclipse one. However, it correctly tracks dependencies between Java and Scala files. I don't think it builds all Java files all the time, but dependency tracking is more coarse-grained.
I wouldn't expect it to recompile B after whitespace-only changes in A, though.
I wouldn't expect it to recompile B after whitespace-only changes in A, though.
on 2013-12-04 14:38 *
By Iulian Dragos
It already does (you can test that by checking that Eclipse Java compiler settings are taken into account). The issue is that the Eclipse Java builder does not know what files to rebuild when they depend on Scala. So we provide the "entry points", by asking to recompile the Java files that Sbt would recompile on the command line itself. I don't know yet why, in this case, Sbt thinks all files have to be recompiled.
on 2013-12-04 16:02 *
By gkossakowski
I tried to reproduce it in Eclipse and it appears to not be a problem with incremental compiler. Specifically, I can reproduce the fact that both class files are touched upon whitespace change in one of Java files but incremental compiler log is showing only one file being recompiled. See the log attached below.
I don't know who is touching those class files but I'm guessing it must be something Eclipse specific.
Here's the log after touching A.java:
I don't know who is touching those class files but I'm guessing it must be something Eclipse specific.
Here's the log after touching A.java:
2013-12-04 15:54:34,687 DEBUG [Worker-58] - EclipseSbtBuildManager -
Initial source changes:
removed:Set()
added: Set()
modified: Set(/Users/grek/Documents/workspace-inc-compiler/test-inc/src/A.java)
Removed products: Set()
Modified external sources: Set()
Modified binary dependencies: Set()
Initial directly invalidated sources: Set(/Users/grek/Documents/workspace-inc-compiler/test-inc/src/A.java)
Sources indirectly invalidated by:
product: Set()
binary dep: Set()
external source: Set()
2013-12-04 15:54:34,687 DEBUG [Worker-58] - EclipseSbtBuildManager - All initially invalidated sources: Set(/Users/grek/Documents/workspace-inc-compiler/test-inc/src/A.java)
2013-12-04 15:54:34,687 INFO [Worker-58] - EclipseSbtBuildManager - Compiling 1 Java source to /Users/grek/Documents/workspace-inc-compiler/test-inc/bin...
2013-12-04 15:54:34,696 DEBUG [Worker-58] - EclipseSbtBuildManager - Java compilation took 0.008115 s
2013-12-04 15:54:34,710 DEBUG [Worker-58] - EclipseSbtBuildManager - Java analysis took 0.013676 s
2013-12-04 15:54:34,710 DEBUG [Worker-58] - EclipseSbtBuildManager - Invalidated by transitive public inheritance: Set()
2013-12-04 15:54:34,710 DEBUG [Worker-58] - EclipseSbtBuildManager - Invalidated by direct dependency: Set()
2013-12-04 15:54:34,710 DEBUG [Worker-58] - EclipseSbtBuildManager - New invalidations:
Set()
2013-12-04 15:54:34,711 DEBUG [Worker-58] - EclipseSbtBuildManager - Previously invalidated, but (transitively) depend on new invalidations:
Set()
on 2013-12-15 20:47 *
By gkossakowski
Good idea on trying the refined build manager! If the problem disappears with refined build managed then it indeed suggests a problem with sbt incremental compiler. I'll try to dig a little bit deeper next week.
No file chosen
You have an empty file field. Please select or remove it.
Name | Size | ||
---|---|---|---|
scalaidetest.zip | 6.58 MB | Added by chentong on 2013-12-03 - Upload new version |