Skip to content

Commit

Permalink
feat(tauri-build): add config-json feature flag
Browse files Browse the repository at this point in the history
This allows disabling rebuilding when `tauri.conf.json` when using another config format

see #8721
  • Loading branch information
amrbashir committed Feb 2, 2024
1 parent 3e5c28f commit 306761f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/tauri-build-config-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-build': 'patch:enhance'
---

Add `config-json` cargo feature flag (enabled by default) to. Disabling this feature flag will stop cargo from rebuilding when `tauri.con.json` changes, see [#8721](https://github.com/tauri-apps/tauri/issues/8721) for more info.
5 changes: 5 additions & 0 deletions .changes/tauri-common-control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'patch:enhance'
---

Add `common-controls-v6` cargo feature flag (enabled by default).
2 changes: 2 additions & 0 deletions core/tauri-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ swift-rs = { version = "1.0.6", features = [ "build" ] }
plist = "1"

[features]
default = [ "config-json" ]
codegen = [ "tauri-codegen", "quote" ]
isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ]
config-json = [ ]
config-json5 = [ "tauri-utils/config-json5" ]
config-toml = [ "tauri-utils/config-toml" ]
1 change: 1 addition & 0 deletions core/tauri-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
use anyhow::anyhow;

println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
#[cfg(feature = "config-json")]
println!("cargo:rerun-if-changed=tauri.conf.json");
#[cfg(feature = "config-json5")]
println!("cargo:rerun-if-changed=tauri.conf.json5");
Expand Down
4 changes: 2 additions & 2 deletions core/tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ default = [
"wry",
"compression",
"objc-exception",
"tray-icon?/common-controls-v6",
"muda/common-controls-v6"
"common-controls-v6"
]
unstable = [ ]
common-controls-v6 = [ "tray-icon?/common-controls-v6", "muda/common-controls-v6" ]
tray-icon = [ "dep:tray-icon" ]
tracing = [
"dep:tracing",
Expand Down

0 comments on commit 306761f

Please sign in to comment.