3

My plan is to take an existing project and slowly transform it to something else. To this aim I took the brutal approach and simply copied the folder of the project as it was to a new folder.

When I ran sbt in the new folder, it resolved some dependencies and recompiled all the sources. This is kind of expected, because the project registry may have contained reference to the absolute path where the project resided earlier and sbt may have detected that it changed.

However when I went back to the old project folder, to which I made no modification and ran sbt in that folder, it recompiled all the sources as well in the original project.

This is a puzzle for me. Why did this happen? Is there a magic link between projects residing in different folders that I'm missing?

sbtpr
  • 541
  • 5
  • 18

1 Answers1

-1

The simplest explantion might be that compilation was not up-to-date when you copied the original project. If that was the case, copying the project would have updated the file modified dates and triggered a recompilation for the new folder. Similarly, when going back to the old folder again, it would still be out-of-date, and sbt would recompile all sources again.

Jon Anderson
  • 696
  • 4
  • 9
  • For the copied project the modified dates may provide an explanation. However the original one was definitely up to date when the copying occured. Yet it recompiled all 20 sources of the original project. – sbtpr Feb 14 '17 at 19:27