Wins Wins - 1 month ago 14
Scala Question

Compiled Scala classes by Gradle not compatible with IntelliJ?

I have scala projects configured with gradle as build tool. During development, I use IntelliJ with configured Scala plugin and Gradle plugin.

My question is why classes compiled by gradle from command line/terminal is not compatible with the one from IntelliJ (i.e. IntelliJ always try to recompile scala classes even if I don't modify anything and just run the test)?

Answer

This is a known bug with IntelliJ which does not look like it is possible to fix. The issue is that IntelliJ has an incremental compiler, and it is very difficult to incorporate externally compiled classes into its dependency graph, because the scalac compiler doesn't produce the custom dependency graph info that IntelliJ uses.

See https://youtrack.jetbrains.com/issue/SCL-8481 and https://youtrack.jetbrains.com/issue/SCL-7711

(More info was at https://github.com/JetBrains/intellij-scala/issues/131 , now deleted)

Comments