Skip to content

[2.x] fix: Fix watchTriggers to control what triggers#8525

Merged
eed3si9n merged 2 commits intosbt:developfrom
mohansinghi:fix/watchTriggers-control-triggers-7130
Jan 14, 2026
Merged

[2.x] fix: Fix watchTriggers to control what triggers#8525
eed3si9n merged 2 commits intosbt:developfrom
mohansinghi:fix/watchTriggers-control-triggers-7130

Conversation

@mohansinghi
Copy link
Copy Markdown
Contributor

Problem

watchTriggers doesn't work as expected - it's always combined with fileInputs, so even when set to watch specific files, other files (like resources) still trigger builds.

Solution

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.

Changes

  • Modified WatchTransitiveDependencies.scala to check if watchTriggers is set before combining with fileInputs
  • When triggerGlobs is non-empty: use only triggerGlobs (plus legacy sources)
  • When triggerGlobs is empty: use existing behavior (combining fileInputs and watchTriggers)

Fixes #7130


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=158349177

mohansinghi and others added 2 commits January 14, 2026 01:49
…nputs

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 sbt#7130
@eed3si9n eed3si9n changed the title Fix watchTriggers to control what triggers instead of adding to fileI… [2.x] fix: Fix watchTriggers to control what triggers Jan 14, 2026
@mohansinghi
Copy link
Copy Markdown
Contributor Author

@eed3si9n Thank you for updating pr title, Could you please check failing check?
I changed only main/src/main/scala/sbt/internal/WatchTransitiveDependencies.scala, bthat is unrelated.

@mohansinghi
Copy link
Copy Markdown
Contributor Author

maybe, need to restart queue?

@mohansinghi
Copy link
Copy Markdown
Contributor Author

@eed3si9n Thank you for restarting.

@eed3si9n eed3si9n merged commit 0c6b4c9 into sbt:develop Jan 14, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

watchTriggers doesn't work as expected.

2 participants