diff --git a/Cargo.lock b/Cargo.lock index b7a8a6db..caca7534 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4344,7 +4344,9 @@ dependencies = [ [[package]] name = "tauri" -version = "2.0.0-alpha.7" +version = "2.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25eefe4ca0a396a73fd0309f778eeb22a19953a3169bf316b893abadc2118fb" dependencies = [ "anyhow", "bytes 1.4.0", @@ -4395,6 +4397,8 @@ dependencies = [ [[package]] name = "tauri-build" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c492211c72b95f8866e5c1fbc0a915080a5ebb9f03f9b250a1c936534b680a76" dependencies = [ "anyhow", "cargo_toml", @@ -4413,6 +4417,8 @@ dependencies = [ [[package]] name = "tauri-codegen" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818c570932ebc2ff6d498be89d93494b89ff142131937a7e56d7cfb9c8ef0ad0" dependencies = [ "base64 0.21.0", "brotli", @@ -4437,6 +4443,8 @@ dependencies = [ [[package]] name = "tauri-macros" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b596485d89003d2d7869469b2830e9a846de9ac2eecd69bc7c24890234aefc" dependencies = [ "heck", "proc-macro2", @@ -4674,6 +4682,8 @@ dependencies = [ [[package]] name = "tauri-runtime" version = "0.13.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404367cd32a5a8d33368448aab7da54bb2187b6a632526f1019de3fd13591cc2" dependencies = [ "gtk", "http", @@ -4694,6 +4704,8 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" version = "0.13.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "203764d673b440877dea87b972772be4091ee0ab25141748008646ca774a20dc" dependencies = [ "cocoa", "gtk", @@ -4713,6 +4725,8 @@ dependencies = [ [[package]] name = "tauri-utils" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fa79bc56f04ece491268a64273de945f65627bcda30d9e8ecc8708b89bca26" dependencies = [ "brotli", "ctor", diff --git a/Cargo.toml b/Cargo.toml index b5bb6889..5f7de541 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,8 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-alpha.6" -tauri-build = "2.0.0-alpha.3" +tauri = "2.0.0-alpha.8" +tauri-build = "2.0.0-alpha.4" serde_json = "1" thiserror = "1" @@ -15,7 +15,3 @@ edition = "2021" authors = [ "Tauri Programme within The Commons Conservancy" ] license = "Apache-2.0 OR MIT" rust-version = "1.64" - -[patch.crates-io] -tauri = { path = "../tauri/core/tauri" } -tauri-build = { path = "../tauri/core/tauri-build" } diff --git a/plugins/dialog/examples/tauri-app/src-tauri/Cargo.lock b/plugins/dialog/examples/tauri-app/src-tauri/Cargo.lock index 0a8c32f5..0e4a9644 100644 --- a/plugins/dialog/examples/tauri-app/src-tauri/Cargo.lock +++ b/plugins/dialog/examples/tauri-app/src-tauri/Cargo.lock @@ -3061,7 +3061,9 @@ dependencies = [ [[package]] name = "tauri" -version = "2.0.0-alpha.7" +version = "2.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25eefe4ca0a396a73fd0309f778eeb22a19953a3169bf316b893abadc2118fb" dependencies = [ "anyhow", "bytes", @@ -3119,6 +3121,8 @@ dependencies = [ [[package]] name = "tauri-build" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c492211c72b95f8866e5c1fbc0a915080a5ebb9f03f9b250a1c936534b680a76" dependencies = [ "anyhow", "cargo_toml", @@ -3137,6 +3141,8 @@ dependencies = [ [[package]] name = "tauri-codegen" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818c570932ebc2ff6d498be89d93494b89ff142131937a7e56d7cfb9c8ef0ad0" dependencies = [ "base64 0.21.0", "brotli", @@ -3162,6 +3168,8 @@ dependencies = [ [[package]] name = "tauri-macros" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b596485d89003d2d7869469b2830e9a846de9ac2eecd69bc7c24890234aefc" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -3192,8 +3200,10 @@ version = "0.1.0" dependencies = [ "android_logger", "byte-unit", + "cocoa", "fern", "log", + "objc", "serde", "serde_json", "serde_repr", @@ -3206,6 +3216,8 @@ dependencies = [ [[package]] name = "tauri-runtime" version = "0.13.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404367cd32a5a8d33368448aab7da54bb2187b6a632526f1019de3fd13591cc2" dependencies = [ "gtk", "http", @@ -3226,6 +3238,8 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" version = "0.13.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "203764d673b440877dea87b972772be4091ee0ab25141748008646ca774a20dc" dependencies = [ "cocoa", "gtk", @@ -3245,6 +3259,8 @@ dependencies = [ [[package]] name = "tauri-utils" version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fa79bc56f04ece491268a64273de945f65627bcda30d9e8ecc8708b89bca26" dependencies = [ "brotli", "ctor", diff --git a/plugins/dialog/examples/tauri-app/src-tauri/Cargo.toml b/plugins/dialog/examples/tauri-app/src-tauri/Cargo.toml index 889d85c6..1abf91c9 100644 --- a/plugins/dialog/examples/tauri-app/src-tauri/Cargo.toml +++ b/plugins/dialog/examples/tauri-app/src-tauri/Cargo.toml @@ -14,12 +14,12 @@ rust-version = "1.64" crate-type = ["staticlib", "cdylib", "rlib"] [build-dependencies] -tauri-build = { version = "2.0.0-alpha.3", features = [] } +tauri-build = { version = "2.0.0-alpha.4", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "2.0.0-alpha.6", features = ["api-all"] } +tauri = { version = "2.0.0-alpha.8", features = ["api-all"] } tauri-plugin-dialog = { path = "../../../" } tauri-plugin-log = { path = "../../../../log" } log = "0.4" @@ -27,7 +27,3 @@ log = "0.4" [features] # DO NOT remove this custom-protocol = [ "tauri/custom-protocol" ] - -[patch.crates-io] -tauri = { path = "../../../../../../tauri/core/tauri" } -tauri-build = { path = "../../../../../../tauri/core/tauri-build" } diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index f7e5e25b..635206eb 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -327,7 +327,7 @@ impl Builder { LogTarget::LogDir => continue, #[cfg(desktop)] LogTarget::LogDir => { - let path = app_handle.path_resolver().app_log_dir().unwrap(); + let path = app_handle.path().app_log_dir().unwrap(); if !path.exists() { fs::create_dir_all(&path).unwrap(); } diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index e93f5002..c7fbc433 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -40,9 +40,9 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let asset_protocol_scope = app.asset_protocol_scope(); let app = app.clone(); - let app_dir = app.path_resolver().app_data_dir(); + let app_dir = app.path().app_data_dir(); - if let Some(app_dir) = app_dir { + if let Ok(app_dir) = app_dir { let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME); let _ = fs_scope.forbid_file(&scope_state_path); diff --git a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml index 2446653b..40d08d7f 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml +++ b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml @@ -12,11 +12,11 @@ rust-version = "1.57" [dependencies] serde_json = "1.0" serde = { version = "1.0", features = [ "derive" ] } -tauri = { version = "1", features = ["api-all"] } +tauri = { version = "2.0.0-alpha.8", features = ["api-all"] } tauri-plugin-single-instance = { path = "../../../" } [build-dependencies] -tauri-build = { version = "1", features = [] } +tauri-build = { version = "2.0.0-alpha.4", features = [] } [features] default = [ "custom-protocol" ] diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs index 656234b0..de501ea3 100644 --- a/plugins/sql/src/plugin.rs +++ b/plugins/sql/src/plugin.rs @@ -63,10 +63,7 @@ type Result = std::result::Result; /// Resolves the App's **file path** from the `AppHandle` context /// object fn app_path(app: &AppHandle) -> PathBuf { - #[allow(deprecated)] // FIXME: Change to non-deprecated function in Tauri v2 - app.path_resolver() - .app_dir() - .expect("No App path was found!") + app.path().app_config_dir().expect("No App path was found!") } #[cfg(feature = "sqlite")] diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index af106e30..c9746b45 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -10,7 +10,7 @@ use std::{ io::Write, path::PathBuf, }; -use tauri::{AppHandle, Runtime}; +use tauri::{AppHandle, Manager, Runtime}; type SerializeFn = fn(&HashMap) -> Result, Box>; type DeserializeFn = fn(&[u8]) -> Result, Box>; @@ -171,7 +171,7 @@ impl Store { /// Update the store from the on-disk state pub fn load(&mut self, app: &AppHandle) -> Result<(), Error> { let app_dir = app - .path_resolver() + .path() .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); @@ -186,7 +186,7 @@ impl Store { /// Saves the store to disk pub fn save(&self, app: &AppHandle) -> Result<(), Error> { let app_dir = app - .path_resolver() + .path() .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); diff --git a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml index 48960dc1..e1d77550 100644 --- a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml @@ -9,14 +9,14 @@ edition = "2021" [dependencies] serde = { version = "1", features = ["derive"] } serde_json = "1" -tauri = { version = "1", features = [] } +tauri = { version = "2.0.0-alpha.8", features = [] } tokio = { version = "1.11", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } tokio-tungstenite = "0.15" [build-dependencies] -tauri-build = { version = "1", features = [] } +tauri-build = { version = "2.0.0-alpha.4", features = [] } [features] default = [ "custom-protocol" ] diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 5a224ad3..b7f34cb1 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -69,7 +69,7 @@ pub trait AppHandleExt { impl AppHandleExt for tauri::AppHandle { fn save_window_state(&self, flags: StateFlags) -> Result<()> { - if let Some(app_dir) = self.path_resolver().app_config_dir() { + if let Ok(app_dir) = self.path().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); let cache = self.state::(); let mut state = cache.0.lock().unwrap(); @@ -270,8 +270,8 @@ impl Builder { let flags = self.state_flags; PluginBuilder::new("window-state") .setup(|app, _api| { - let cache: Arc>> = if let Some(app_dir) = - app.path_resolver().app_config_dir() + let cache: Arc>> = if let Ok(app_dir) = + app.path().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); if state_path.exists() {