From bad85a1f11da03421401080531275ba201480cd1 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 13 May 2022 06:39:04 -0700 Subject: [PATCH] feat(build): find .ico in config instead of default `icons/icon.ico` (#4115) --- .changes/find-icon.md | 5 + core/tauri-build/src/lib.rs | 48 +- core/tests/app-updater/build.rs | 8 +- examples/api/src-tauri/Cargo.lock | 567 ++++-------------- examples/api/src-tauri/build.rs | 9 +- examples/resources/src-tauri/build.rs | 9 +- examples/sidecar/src-tauri/build.rs | 9 +- examples/tauri-dynamic-lib/src-tauri/build.rs | 9 +- examples/updater/src-tauri/build.rs | 9 +- .../tests/cpu_intensive/src-tauri/build.rs | 8 +- .../tests/files_transfer/src-tauri/build.rs | 8 +- .../bench/tests/helloworld/src-tauri/build.rs | 8 +- 12 files changed, 141 insertions(+), 556 deletions(-) create mode 100644 .changes/find-icon.md diff --git a/.changes/find-icon.md b/.changes/find-icon.md new file mode 100644 index 000000000..15de67b6b --- /dev/null +++ b/.changes/find-icon.md @@ -0,0 +1,5 @@ +--- +"tauri-build": patch +--- + +Search `tauri.conf.json > tauri > bundle > icons` for a `.ico` file for the window icon instead of simple default `icons/icon.ico` when `WindowsAttributes::window_icon_path` is not set. diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index bb8730e43..5bc9188d4 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -60,24 +60,15 @@ fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> { /// Attributes used on Windows. #[allow(dead_code)] -#[derive(Debug)] +#[derive(Debug, Default)] pub struct WindowsAttributes { - window_icon_path: PathBuf, + window_icon_path: Option, /// The path to the sdk location. This can be a absolute or relative path. If not supplied /// this defaults to whatever `winres` crate determines is the best. See the /// [winres documentation](https://docs.rs/winres/*/winres/struct.WindowsResource.html#method.set_toolkit_path) sdk_dir: Option, } -impl Default for WindowsAttributes { - fn default() -> Self { - Self { - window_icon_path: PathBuf::from("icons/icon.ico"), - sdk_dir: None, - } - } -} - impl WindowsAttributes { /// Creates the default attribute set. pub fn new() -> Self { @@ -88,7 +79,9 @@ impl WindowsAttributes { /// It must be in `ico` format. Defaults to `icons/icon.ico`. #[must_use] pub fn window_icon_path>(mut self, window_icon_path: P) -> Self { - self.window_icon_path = window_icon_path.as_ref().into(); + self + .window_icon_path + .replace(window_icon_path.as_ref().into()); self } @@ -230,16 +223,16 @@ pub fn try_build(attributes: Attributes) -> Result<()> { .parent() .unwrap(); - if let Some(paths) = config.tauri.bundle.external_bin { + if let Some(paths) = &config.tauri.bundle.external_bin { copy_binaries( - ResourcePaths::new(external_binaries(&paths, &target_triple).as_slice(), true), + ResourcePaths::new(external_binaries(paths, &target_triple).as_slice(), true), &target_triple, target_dir, )?; } #[allow(unused_mut)] - let mut resources = config.tauri.bundle.resources.unwrap_or_default(); + let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default(); #[cfg(target_os = "linux")] if let Some(tray) = config.tauri.system_tray { resources.push(tray.icon_path.display().to_string()); @@ -259,13 +252,24 @@ pub fn try_build(attributes: Attributes) -> Result<()> { use semver::Version; use winres::{VersionInfo, WindowsResource}; - let icon_path_string = attributes + fn find_icon bool>(config: &Config, predicate: F, default: &str) -> PathBuf { + let icon_path = config + .tauri + .bundle + .icon + .iter() + .find(|i| predicate(i)) + .cloned() + .unwrap_or_else(|| default.to_string()); + icon_path.into() + } + + let window_icon_path = attributes .windows_attributes .window_icon_path - .to_string_lossy() - .into_owned(); + .unwrap_or_else(|| find_icon(&config, |i| i.ends_with(".ico"), "icons/icon.ico")); - if attributes.windows_attributes.window_icon_path.exists() { + if window_icon_path.exists() { let mut res = WindowsResource::new(); if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir { if let Some(sdk_dir_str) = sdk_dir.to_str() { @@ -289,17 +293,17 @@ pub fn try_build(attributes: Attributes) -> Result<()> { res.set("ProductName", product_name); res.set("FileDescription", product_name); } - res.set_icon_with_id(&icon_path_string, "32512"); + res.set_icon_with_id(&window_icon_path.display().to_string(), "32512"); res.compile().with_context(|| { format!( "failed to compile `{}` into a Windows Resource file during tauri-build", - icon_path_string + window_icon_path.display() ) })?; } else { return Err(anyhow!(format!( "`{}` not found; required for generating a Windows Resource file during tauri-build", - icon_path_string + window_icon_path.display() ))); } } diff --git a/core/tests/app-updater/build.rs b/core/tests/app-updater/build.rs index 7361c3f72..71557e5b9 100644 --- a/core/tests/app-updater/build.rs +++ b/core/tests/app-updater/build.rs @@ -2,12 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build(Attributes::new().windows_attributes( - WindowsAttributes::new().window_icon_path("../../../examples/.icons/icon.ico"), - )) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 891ed310b..71996c52c 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -105,98 +105,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" -[[package]] -name = "async-broadcast" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90622698a1218e0b2fb846c97b5f19a0831f6baddee73d9454156365ccfa473b" -dependencies = [ - "easy-parallel", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-io" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" -dependencies = [ - "concurrent-queue", - "futures-lite", - "libc", - "log", - "once_cell", - "parking", - "polling", - "slab", - "socket2", - "waker-fn", - "winapi", -] - -[[package]] -name = "async-lock" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-recursion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "async-task" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" - -[[package]] -name = "async-trait" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atk" version = "0.15.1" @@ -215,8 +123,8 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] @@ -345,12 +253,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - [[package]] name = "cairo-rs" version = "0.15.10" @@ -370,7 +272,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" dependencies = [ - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", ] @@ -408,15 +310,6 @@ dependencies = [ "uuid 0.8.2", ] -[[package]] -name = "cfg-expr" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b412e83326147c2bb881f8b40edfbf9905b9b8abaebd0e47ca190ba62fda8f0e" -dependencies = [ - "smallvec", -] - [[package]] name = "cfg-expr" version = "0.9.1" @@ -512,15 +405,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - [[package]] name = "convert_case" version = "0.4.0" @@ -738,6 +622,17 @@ dependencies = [ "syn", ] +[[package]] +name = "dbus" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0a745c25b32caa56b82a3950f5fec7893a960f4c10ca3b02060b0c38d8c2ce" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + [[package]] name = "deflate" version = "0.7.20" @@ -757,17 +652,6 @@ dependencies = [ "adler32", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -833,18 +717,6 @@ dependencies = [ "dtoa", ] -[[package]] -name = "easy-parallel" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946" - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - [[package]] name = "embed_plist" version = "1.2.2" @@ -860,33 +732,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enumflags2" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b3ab37dc79652c9d85f1f7b6070d77d321d2467f5fe7b00d6b7a86c57b092ae" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "event-listener" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" - [[package]] name = "fastrand" version = "1.7.0" @@ -1119,9 +964,9 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" dependencies = [ - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] @@ -1134,9 +979,9 @@ checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "pkg-config", @@ -1150,7 +995,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" dependencies = [ "gdk-sys", - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", "x11", @@ -1221,34 +1066,21 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", - "gio-sys 0.15.10", + "gio-sys", "glib", "libc", "once_cell", "thiserror", ] -[[package]] -name = "gio-sys" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a41df66e57fcc287c4bcf74fc26b884f31901ea9792ec75607289b456f48fa" -dependencies = [ - "glib-sys 0.14.0", - "gobject-sys 0.14.0", - "libc", - "system-deps 3.2.0", - "winapi", -] - [[package]] name = "gio-sys" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", "winapi", @@ -1266,8 +1098,8 @@ dependencies = [ "futures-executor", "futures-task", "glib-macros", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "once_cell", "smallvec", @@ -1289,16 +1121,6 @@ dependencies = [ "syn", ] -[[package]] -name = "glib-sys" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1d60554a212445e2a858e42a0e48cece1bd57b311a19a9468f70376cf554ae" -dependencies = [ - "libc", - "system-deps 3.2.0", -] - [[package]] name = "glib-sys" version = "0.15.10" @@ -1328,24 +1150,13 @@ dependencies = [ "regex", ] -[[package]] -name = "gobject-sys" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa92cae29759dae34ab5921d73fff5ad54b3d794ab842c117e36cafc7994c3f5" -dependencies = [ - "glib-sys 0.14.0", - "libc", - "system-deps 3.2.0", -] - [[package]] name = "gobject-sys" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" dependencies = [ - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", ] @@ -1383,9 +1194,9 @@ dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "system-deps 6.0.2", @@ -1454,12 +1265,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "html5ever" version = "0.25.2" @@ -1476,9 +1281,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" dependencies = [ "bytes", "fnv", @@ -1639,15 +1444,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.8" @@ -1677,8 +1473,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 5.0.0", ] @@ -1782,6 +1578,15 @@ version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" +[[package]] +name = "libdbus-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +dependencies = [ + "pkg-config", +] + [[package]] name = "lock_api" version = "0.4.6" @@ -2041,19 +1846,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nix" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "memoffset", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -2066,12 +1858,9 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" dependencies = [ + "dbus", "mac-notification-sys", - "serde", "winrt-notification", - "zbus", - "zvariant", - "zvariant_derive", ] [[package]] @@ -2247,16 +2036,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "ordered-stream" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "os_info" version = "3.2.0" @@ -2306,8 +2085,8 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] @@ -2527,19 +2306,6 @@ dependencies = [ "miniz_oxide 0.5.1", ] -[[package]] -name = "polling" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" -dependencies = [ - "cfg-if", - "libc", - "log", - "wepoll-ffi", - "winapi", -] - [[package]] name = "polyval" version = "0.5.3" @@ -2822,8 +2588,8 @@ checksum = "e7ca9214be1b6d296d4d539a31e795e556cdb43e60cbf0b77003be5b01075c13" dependencies = [ "block", "dispatch", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "gtk-sys", "js-sys", "lazy_static", @@ -3075,21 +2841,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "sha2" version = "0.10.2" @@ -3149,15 +2900,29 @@ dependencies = [ ] [[package]] -name = "soup2-sys" -version = "0.1.0" +name = "soup2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f056675eda9a7417163e5f742bb119e8e1d385edd2ada8f7031a7230a3ec10a" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" dependencies = [ "bitflags", - "gio-sys 0.14.0", - "glib-sys 0.14.0", - "gobject-sys 0.14.0", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps 5.0.0", ] @@ -3177,12 +2942,6 @@ dependencies = [ "loom", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "string_cache" version = "0.8.4" @@ -3221,31 +2980,13 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" - [[package]] name = "strum" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" dependencies = [ - "strum_macros 0.22.0", -] - -[[package]] -name = "strum_macros" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn", + "strum_macros", ] [[package]] @@ -3277,24 +3018,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "system-deps" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6" -dependencies = [ - "anyhow", - "cfg-expr 0.8.1", - "heck 0.3.3", - "itertools", - "pkg-config", - "strum 0.21.0", - "strum_macros 0.21.1", - "thiserror", - "toml", - "version-compare 0.0.11", -] - [[package]] name = "system-deps" version = "5.0.0" @@ -3323,9 +3046,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3765f329d831aa461cd3f0f94b065a9fe37560fd7f8099d5bcf3e95c923071f0" +checksum = "1fd55783f88aafed0c5510ae540716455297f4f6df08f8114dc9fddc37d76ee3" dependencies = [ "bitflags", "cairo-rs", @@ -3341,7 +3064,7 @@ dependencies = [ "gdkx11-sys", "gio", "glib", - "glib-sys 0.15.10", + "glib-sys", "gtk", "instant", "lazy_static", @@ -3389,7 +3112,7 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.0-rc.8" +version = "1.0.0-rc.10" dependencies = [ "anyhow", "attohttpc", @@ -3397,6 +3120,7 @@ dependencies = [ "bincode", "bytes", "clap", + "cocoa", "dirs-next", "embed_plist", "flate2", @@ -3412,6 +3136,7 @@ dependencies = [ "infer", "minisign-verify", "notify-rust", + "objc", "once_cell", "open", "os_info", @@ -3440,16 +3165,19 @@ dependencies = [ "tokio", "url", "uuid 1.0.0", + "webkit2gtk", + "webview2-com", "windows 0.30.0", "zip", ] [[package]] name = "tauri-build" -version = "1.0.0-rc.7" +version = "1.0.0-rc.8" dependencies = [ "anyhow", "cargo_toml", + "semver 1.0.7", "serde_json", "tauri-codegen", "tauri-utils", @@ -3458,7 +3186,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.0.0-rc.5" +version = "1.0.0-rc.6" dependencies = [ "base64", "brotli", @@ -3478,7 +3206,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.0.0-rc.5" +version = "1.0.0-rc.6" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3490,7 +3218,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.4.0" +version = "0.5.0" dependencies = [ "gtk", "http", @@ -3507,14 +3235,16 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.4.0" +version = "0.5.1" dependencies = [ + "cocoa", "gtk", "percent-encoding", "rand 0.8.5", "tauri-runtime", "tauri-utils", "uuid 1.0.0", + "webkit2gtk", "webview2-com", "windows 0.30.0", "wry", @@ -3522,7 +3252,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.0.0-rc.5" +version = "1.0.0-rc.6" dependencies = [ "aes-gcm", "brotli", @@ -4058,48 +3788,49 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cbd39499e917de9dad36eb11c09f665eb984d432638ae7971feed98eb96df88" +checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc" dependencies = [ "bitflags", "cairo-rs", "gdk", "gdk-sys", "gio", - "gio-sys 0.15.10", + "gio-sys", "glib", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "gtk", "gtk-sys", "javascriptcore-rs", "libc", "once_cell", + "soup2", "webkit2gtk-sys", ] [[package]] name = "webkit2gtk-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddcce6f1e0fc7715d651dba29875741509f5fc12f4e2976907272a74405f2b01" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" dependencies = [ "atk-sys", "bitflags", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk-sys", "javascriptcore-rs-sys", "libc", "pango-sys", "pkg-config", "soup2-sys", - "system-deps 5.0.0", + "system-deps 6.0.2", ] [[package]] @@ -4139,15 +3870,6 @@ dependencies = [ "windows-bindgen", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "wildmatch" version = "2.1.0" @@ -4418,16 +4140,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "007a0353840b23e0c6dc73e5b962ff58ed7f6bc9ceff3ce7fe6fbad8d496edf4" dependencies = [ - "strum 0.22.0", + "strum", "windows 0.24.0", "xml-rs", ] [[package]] name = "wry" -version = "0.15.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b69cff9f50bab10b42e51bac9c2cf695484059f1b19e911754477ae703ef42" +checksum = "a5676092e1a33448ed0f268717bcbb2e928354b78f4c1f60f3d43641eedea0d9" dependencies = [ "block", "cocoa", @@ -4491,67 +4213,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" -[[package]] -name = "zbus" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bb86f3d4592e26a48b2719742aec94f8ae6238ebde20d98183ee185d1275e9a" -dependencies = [ - "async-broadcast", - "async-channel", - "async-executor", - "async-io", - "async-lock", - "async-recursion", - "async-task", - "async-trait", - "byteorder", - "derivative", - "enumflags2", - "event-listener", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "lazy_static", - "nix", - "once_cell", - "ordered-stream", - "rand 0.8.5", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "winapi", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36823cc10fddc3c6b19f048903262dacaf8274170e9a255784bdd8b4570a8040" -dependencies = [ - "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", - "regex", - "syn", -] - -[[package]] -name = "zbus_names" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45dfcdcf87b71dad505d30cc27b1b7b88a64b6d1c435648f48f9dbc1fdc4b7e1" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - [[package]] name = "zip" version = "0.6.0" @@ -4561,29 +4222,3 @@ dependencies = [ "byteorder", "crc32fast", ] - -[[package]] -name = "zvariant" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ea5dc38b2058fae6a5b79009388143dadce1e91c26a67f984a0fc0381c8033" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2cecc5a61c2a053f7f653a24cd15b3b0195d7f7ddb5042c837fb32e161fb7a" -dependencies = [ - "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", - "syn", -] diff --git a/examples/api/src-tauri/build.rs b/examples/api/src-tauri/build.rs index 017a75d00..71557e5b9 100644 --- a/examples/api/src-tauri/build.rs +++ b/examples/api/src-tauri/build.rs @@ -2,13 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build( - Attributes::new() - .windows_attributes(WindowsAttributes::new().window_icon_path("../../.icons/icon.ico")), - ) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/examples/resources/src-tauri/build.rs b/examples/resources/src-tauri/build.rs index 017a75d00..71557e5b9 100644 --- a/examples/resources/src-tauri/build.rs +++ b/examples/resources/src-tauri/build.rs @@ -2,13 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build( - Attributes::new() - .windows_attributes(WindowsAttributes::new().window_icon_path("../../.icons/icon.ico")), - ) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/examples/sidecar/src-tauri/build.rs b/examples/sidecar/src-tauri/build.rs index 017a75d00..71557e5b9 100644 --- a/examples/sidecar/src-tauri/build.rs +++ b/examples/sidecar/src-tauri/build.rs @@ -2,13 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build( - Attributes::new() - .windows_attributes(WindowsAttributes::new().window_icon_path("../../.icons/icon.ico")), - ) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/examples/tauri-dynamic-lib/src-tauri/build.rs b/examples/tauri-dynamic-lib/src-tauri/build.rs index 017a75d00..71557e5b9 100644 --- a/examples/tauri-dynamic-lib/src-tauri/build.rs +++ b/examples/tauri-dynamic-lib/src-tauri/build.rs @@ -2,13 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build( - Attributes::new() - .windows_attributes(WindowsAttributes::new().window_icon_path("../../.icons/icon.ico")), - ) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/examples/updater/src-tauri/build.rs b/examples/updater/src-tauri/build.rs index 017a75d00..71557e5b9 100644 --- a/examples/updater/src-tauri/build.rs +++ b/examples/updater/src-tauri/build.rs @@ -2,13 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build( - Attributes::new() - .windows_attributes(WindowsAttributes::new().window_icon_path("../../.icons/icon.ico")), - ) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/tooling/bench/tests/cpu_intensive/src-tauri/build.rs b/tooling/bench/tests/cpu_intensive/src-tauri/build.rs index ecfc77b39..71557e5b9 100644 --- a/tooling/bench/tests/cpu_intensive/src-tauri/build.rs +++ b/tooling/bench/tests/cpu_intensive/src-tauri/build.rs @@ -2,12 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build(Attributes::new().windows_attributes( - WindowsAttributes::new().window_icon_path("../../../../../examples/.icons/icon.ico"), - )) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/tooling/bench/tests/files_transfer/src-tauri/build.rs b/tooling/bench/tests/files_transfer/src-tauri/build.rs index ecfc77b39..71557e5b9 100644 --- a/tooling/bench/tests/files_transfer/src-tauri/build.rs +++ b/tooling/bench/tests/files_transfer/src-tauri/build.rs @@ -2,12 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build(Attributes::new().windows_attributes( - WindowsAttributes::new().window_icon_path("../../../../../examples/.icons/icon.ico"), - )) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() } diff --git a/tooling/bench/tests/helloworld/src-tauri/build.rs b/tooling/bench/tests/helloworld/src-tauri/build.rs index ecfc77b39..71557e5b9 100644 --- a/tooling/bench/tests/helloworld/src-tauri/build.rs +++ b/tooling/bench/tests/helloworld/src-tauri/build.rs @@ -2,12 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri_build::{try_build, Attributes, WindowsAttributes}; - fn main() { - if let Err(error) = try_build(Attributes::new().windows_attributes( - WindowsAttributes::new().window_icon_path("../../../../../examples/.icons/icon.ico"), - )) { - panic!("error found during tauri-build: {:#?}", error); - } + tauri_build::build() }