mirror of https://github.com/sbt/sbt.git
[2.x] Fix watchTriggers to control what triggers instead of adding to fileInputs (#8525)
When watchTriggers is explicitly set (non-empty), use only watchTriggers instead of combining them with fileInputs. This allows users to control what triggers the watch by setting watchTriggers. Fixes #7130
This commit is contained in:
parent
43e0428bed
commit
0c6b4c9741
|
|
@ -135,7 +135,14 @@ private[sbt] object WatchTransitiveDependencies {
|
|||
triggers.flatMap(getDynamicInputs(_, trigger = true))
|
||||
)
|
||||
}
|
||||
(inputGlobs ++ triggerGlobs ++ legacy(keys :+ scopedKey, args)).distinct.sorted
|
||||
// If watchTriggers is explicitly set (non-empty), use only watchTriggers instead of combining with fileInputs
|
||||
// This allows users to control what triggers the watch by setting watchTriggers
|
||||
val result = if (triggerGlobs.nonEmpty) {
|
||||
triggerGlobs ++ legacy(keys :+ scopedKey, args)
|
||||
} else {
|
||||
inputGlobs ++ triggerGlobs ++ legacy(keys :+ scopedKey, args)
|
||||
}
|
||||
result.distinct.sorted
|
||||
}
|
||||
|
||||
private def legacy(keys: Seq[ScopedKey[?]], args: Arguments): Seq[DynamicInput] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue