Skip to content

fix(build): rerun when resource dirs change - #11

Merged
OlympusLedgerOrg merged 2 commits into
devfrom
fix-resource-rerun-if-changed
Jul 11, 2026
Merged

fix(build): rerun when resource dirs change#11
OlympusLedgerOrg merged 2 commits into
devfrom
fix-resource-rerun-if-changed

Conversation

@OlympusLedgerOrg

@OlympusLedgerOrg OlympusLedgerOrg commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Track resource directories and glob base directories while iterating configured resources.
  • Emit cargo:rerun-if-changed for those directories so adding or removing resource files reruns the build script.
  • Add a regression test and covector change file.

Validation

  • cargo fmt --all -- --check
  • cargo test -p tauri-utils resources::tests
  • cargo check -p tauri-build
  • cargo clippy -p tauri-utils -p tauri-build --all-targets --all-features -- -D warnings
  • Manual e2e repro: after a clean no-op build was Fresh, adding files under both
    esources and glob-assets/* reran the build script and copied the new files into arget/debug resources.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed resource handling so changes to files within configured resource directories are detected automatically.
    • Added support for rebuilding and re-copying resources when files are added, removed, or modified.
    • Improved rebuild detection for resources specified through directory paths and wildcard patterns.
  • Tests
    • Added coverage to verify resource directories are monitored correctly without unnecessarily watching individual files.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: adc67559-13b9-4eb3-b612-a7c2888d22c5

📥 Commits

Reviewing files that changed from the base of the PR and between 1afd9bd and 732dcbe.

📒 Files selected for processing (3)
  • .changes/fix-copy-new-resource-files.md
  • crates/tauri-build/src/lib.rs
  • crates/tauri-utils/src/resources.rs

📝 Walkthrough

Walkthrough

Resource iteration now records relevant directories, and copy_resources emits Cargo rebuild directives for them so changes to resource contents trigger resource copying.

Changes

Resource Change Watching

Layer / File(s) Summary
Track resource directories
crates/tauri-utils/src/resources.rs
ResourcePathsIter records glob bases and walked directories, exposes the tracked paths, and tests the resulting watch list.
Emit Cargo watch directives
crates/tauri-build/src/lib.rs, .changes/fix-copy-new-resource-files.md
copy_resources emits cargo:rerun-if-changed for tracked directories, and the change entry records the dependency and build behavior updates.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant copy_resources
  participant ResourcePathsIter
  participant Cargo
  copy_resources->>ResourcePathsIter: iterate resource paths
  ResourcePathsIter-->>copy_resources: return tracked directories
  copy_resources->>Cargo: emit cargo:rerun-if-changed directives
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: build scripts now rerun when resource directories change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-resource-rerun-if-changed
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix-resource-rerun-if-changed

Comment @coderabbitai help to get the list of available commands.

@OlympusLedgerOrg
OlympusLedgerOrg merged commit 53d7327 into dev Jul 11, 2026
31 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.

1 participant