You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if using IntelliJ IDE, make sure you have highlighting set to Built-in, not Compiler
from sbt use clean;compile
change the local variable name in Entities.f or change the comment in the same file
use compile
problem
Both files are compiled:
[info] compiling 2 Scala sources to C:\Dev\ZincOvercompile\target\scala-2.13\classes ...
expectation
On a change which does not change the API, no other source files than the one edited should be compiled.
notes
I have developed a SBT plugin to help me isolating problems like this. It checks sbt.internal.inc.Analysis and prints which files were compiled and what classed have changed their API as a result of compilation. When using this plugin on this repro, it does not show any API changes.
In a real project much more files are compiled than just 2, often in multiple compilation cycles
The same repro works with Scala 3 and 2
The repro is surprisingly simple:
Entities.scala:
objectEntities {
// change comment HERE to trigger compilation of both files// or rename the local variable belowdeff():Unit= {
valadd142=0
}
}
classEntities {
defget(id: EntityId[EntityState]):Option[Int] =???
}
This behaviour is intentional. State.scala refers to Entities.scala and vice versa, hence using strategy proposed in #598 (comment) both files are invalidated in the first cycle.
Oh my. 😞Back to the repro of the original issue of over-compilation of 100 files, which will be something different. With the plugin ready it should hopefully not take a whole day this time. 😶
Follow-up to #1396
steps
clean;compile
Entities.f
or change the comment in the same filecompile
problem
Both files are compiled:
expectation
On a change which does not change the API, no other source files than the one edited should be compiled.
notes
sbt.internal.inc.Analysis
and prints which files were compiled and what classed have changed their API as a result of compilation. When using this plugin on this repro, it does not show any API changes.The repro is surprisingly simple:
Entities.scala:
State.scala:
The text was updated successfully, but these errors were encountered: