I face the following problem when using SBT. If I add this line to build.sbt:
unmanagedResourceDirectories in Compile <+= baseDirectory( _ / "src/main/scala" )
Incremental compilation breaks in a very tricky and not-nice way. A full example on how to reproduce the bug is here: https://github.com/vn971/sbt-incremental-bug
It's basically 2 files. Implicits.scala:
object MyImplicits {
implicit def stringToInt(str: String) = 1
}
And Usage.scala:
import MyImplicits._
object MyUsage {
def a: Int = ""
}
Now, in order to reproduce the incremental compilation bug, you have to do consequent changes to these files:
- comment out the method in Usage.scala. Save file, re-compile.
- uncomment it, save and re-compile.
- comment out the method in Implicits.scala. Save file, re-compile.
Since MyImplicits.stringToInt is undoubtedly used in Usage.scala, it should not compile. But it does, with incremental compilation.
Thoughts? Questions? If you need more details than already provided, check out the minimalistic project I've linked to.