diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 6664c493566..6405a288698 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -315,11 +315,13 @@ object Defaults extends BuildCommon { excludeFilter in unmanagedSources).value, watchSources in ConfigGlobal ++= { val baseDir = baseDirectory.value - val bases = unmanagedSourceDirectories.value ++ (if (sourcesInBase.value) Seq(baseDir) - else Seq.empty) + val bases = unmanagedSourceDirectories.value val include = (includeFilter in unmanagedSources).value val exclude = (excludeFilter in unmanagedSources).value - bases.map(b => new Source(b, include, exclude)) + val baseSources = + if (sourcesInBase.value) Seq(new Source(baseDir, include, exclude, recursive = false)) + else Nil + bases.map(b => new Source(b, include, exclude)) ++ baseSources }, managedSourceDirectories := Seq(sourceManaged.value), managedSources := generate(sourceGenerators).value, diff --git a/notes/1.0.3/watch2.md b/notes/1.0.3/watch2.md new file mode 100644 index 00000000000..69b30cede14 --- /dev/null +++ b/notes/1.0.3/watch2.md @@ -0,0 +1,12 @@ +[@dwijnand]: https://github.com/dwijnand + +[#3501]: https://github.com/sbt/sbt/issues/3501 +[#3634]: https://github.com/sbt/sbt/pull/3634 + +### Fixes with compatibility implications + +### Improvements + +### Bug fixes + +- Fixes `~` to recompile on loop (when a source generator or sbt-buildinfo is present). [#3501][]/[#3634][] by [@dwijnand][]