diff --git a/.changes/tauri-build-config-json.md b/.changes/tauri-build-config-json.md new file mode 100644 index 000000000..9e27852e9 --- /dev/null +++ b/.changes/tauri-build-config-json.md @@ -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.conf.json` changes, see [#8721](https://github.com/tauri-apps/tauri/issues/8721) for more info. diff --git a/.changes/tauri-common-control.md b/.changes/tauri-common-control.md new file mode 100644 index 000000000..2cf07bc29 --- /dev/null +++ b/.changes/tauri-common-control.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:enhance' +--- + +Add `common-controls-v6` cargo feature flag (enabled by default). diff --git a/core/tauri-build/Cargo.toml b/core/tauri-build/Cargo.toml index f94bf58e1..0d92dcf95 100644 --- a/core/tauri-build/Cargo.toml +++ b/core/tauri-build/Cargo.toml @@ -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" ] diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index ad3a68be8..b568c56cc 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -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"); diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 928628800..c650f36ae 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -111,7 +111,7 @@ swift-rs = "1.0.6" [build-dependencies] heck = "0.4" -tauri-build = { path = "../tauri-build/", version = "2.0.0-alpha.14" } +tauri-build = { path = "../tauri-build/", default-features = false, version = "2.0.0-alpha.14" } tauri-utils = { path = "../tauri-utils/", version = "2.0.0-alpha.13", features = [ "build" ] } [dev-dependencies] @@ -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", diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 10de093a3..394f9820a 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -13,6 +13,7 @@ //! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that can be enabled or disabled: //! //! - **wry** *(enabled by default)*: Enables the [wry](https://github.com/tauri-apps/wry) runtime. Only disable it if you want a custom runtime. +//! - **common-controls-v6** *(enabled by default)*: Enables [Common Controls v6](https://learn.microsoft.com/en-us/windows/win32/controls/common-control-versions) support on Windows, mainly for the predefined `about` menu item. //! - **unstable**: Enables unstable features. Be careful, it might introduce breaking changes in future minor releases. //! - **tracing**: Enables [`tracing`](https://docs.rs/tracing/latest/tracing) for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers. //! - **test**: Enables the [`mod@test`] module exposing unit test helpers. diff --git a/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml b/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml index 4d3131b6a..80e05a707 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml +++ b/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml @@ -11,5 +11,5 @@ serde = "1" thiserror = "1" [build-dependencies] -tauri-build = { path = "../../../../core/tauri-build/" } +tauri-build = { path = "../../../../core/tauri-build/", default-features = false } tauri-plugin = { path = "../../../../core/tauri-plugin", features = ["build"] } diff --git a/tooling/cli/src/plugin/init.rs b/tooling/cli/src/plugin/init.rs index 7829bce25..fe484274a 100644 --- a/tooling/cli/src/plugin/init.rs +++ b/tooling/cli/src/plugin/init.rs @@ -96,7 +96,7 @@ pub fn command(mut options: Options) -> Result<()> { resolve_tauri_path(&tauri_path, "core/tauri") ), format!( - "{{ path = {:?} }}", + "{{ path = {:?}, default-features = false }}", resolve_tauri_path(&tauri_path, "core/tauri-build") ), format!( @@ -108,7 +108,10 @@ pub fn command(mut options: Options) -> Result<()> { ( format!(r#"{{ version = "{}" }}"#, metadata.tauri), format!(r#"{{ version = "{}" }}"#, metadata.tauri), - format!(r#"{{ version = "{}" }}"#, metadata.tauri_build), + format!( + r#"{{ version = "{}", default-features = false }}"#, + metadata.tauri_build + ), format!( r#"{{ version = "{}", features = ["build"] }}"#, metadata.tauri_plugin