Monitor project build sources

In sbt 1.3.0, we only monitor build sources in the root project
directory and the root project meta build directory. This commit adds
these inputs for each project.

Fixes https://github.com/sbt/sbt/issues/5061.
This commit is contained in:
Ethan Atkins 2019-09-16 11:57:50 -07:00
parent ab2f3d6757
commit 26e60e9b6a
8 changed files with 21 additions and 2 deletions

View File

@ -371,13 +371,16 @@ object Defaults extends BuildCommon {
}).value
)
def paths = Seq(
// Appended to JvmPlugin.projectSettings
def paths: Seq[Setting[_]] = Seq(
baseDirectory := thisProject.value.base,
target := baseDirectory.value / "target",
historyPath := (historyPath or target(t => Option(t / ".history"))).value,
sourceDirectory := baseDirectory.value / "src",
sourceManaged := crossTarget.value / "src_managed",
resourceManaged := crossTarget.value / "resource_managed"
resourceManaged := crossTarget.value / "resource_managed",
// Adds subproject build.sbt files to the global list of build files to monitor
Scope.Global / checkBuildSources / fileInputs += baseDirectory.value.toGlob / "*.sbt"
)
lazy val configPaths = sourceConfigPaths ++ resourceConfigPaths ++ outputConfigPaths

View File

@ -11,3 +11,5 @@ exists := {
}
Global / onChangedBuildSource := ReloadOnSourceChanges
val sub = project

View File

@ -8,3 +8,5 @@ exists := {
}
Global / onChangedBuildSource := ReloadOnSourceChanges
val sub = project

View File

@ -0,0 +1 @@
libraryDependencies += "org.scala-sbt" % "sbt" % "1.3.0"

View File

@ -11,3 +11,5 @@ exists := {
}
Global / onChangedBuildSource := ReloadOnSourceChanges
val sub = project

View File

@ -0,0 +1,3 @@
object Test {
val x = sbt.Keys
}

View File

@ -17,3 +17,9 @@ $ copy-file changes/working.sbt build.sbt
> foo foo; reload
> exists foo
-> compile
$ copy-file changes/sub.sbt sub/build.sbt
> compile