sbt/scripted-sbt-redux
Ethan Atkins dcccd17fd2 Improve managed file management in watch
@olegych reported in https://github.com/sbt/sbt/issues/4722 that
sometimes even when a build was triggered during watch that no
recompilation would occur. The cause of this was that we never
invalidated the file stamp cache for managed sources or output files.
The optimization of persisting the source file stamps between task
evaluations in a continuous build only really makes sense for unmanaged
sources. We make the implicit assumption that unmanaged sources are
infrequently updated and generally one at a time. That assumption does
not hold for unmanaged source or output files.

To fix this, I split the fileStampCache into two caches: one for
unmanaged sources and one for everything else. We only persist the
unmanagedFileStampCache during continuous builds. The
managedFileStampCache gets invalidated every time.

I added a scripted test that simulates changing a generated source file.
Prior to this change, the test would fail because the file stamp was not
invalidated for the new source file content.

Fixes #4722
2019-05-29 17:28:04 -07:00
..
src/main/scala/sbt/scriptedtest Improve managed file management in watch 2019-05-29 17:28:04 -07:00
NOTICE create scripted-sbt-redux 2018-07-10 03:13:47 -04:00