Consider the scenario: I have a simple scala project managed by sbt, in a directory called foo
.
cd foo
sbt compile
It now takes a few seconds and the project compiles correctly.
Now, thanks to sbt incremental compilation, if I run
sbt compile
it terminates the compile task in close to 0 seconds, since the source code hasn't changed.
But if I rename the foo
directory into bar
cd ..
mv foo bar
and try to compile it again
cd bar
sbt compile
now the compile task takes again few seconds, hence not using the results from the previous compilation.
Is there a way to preserve the incremental compilation results of a project even when its absolute path on disk has changed?