From 96b5e92169125e3d9083724c22f8e4ea0184951c Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 12 Feb 2023 10:29:34 -0800 Subject: [PATCH] refactor(core): inject API project on plugin's Android and iOS projects (#6246) --- .gitignore | 4 - Package.swift | 28 -- core/tauri-build/src/mobile.rs | 62 ++- core/tauri-build/templates/Package.swift | 23 - core/tauri/build.rs | 6 +- core/tauri/mobile/ios-api/.gitignore | 1 + .../src-tauri/tauri-plugin-sample/Cargo.lock | 464 +++++++++--------- .../tauri-plugin-sample/android/.gitignore | 3 +- .../tauri-plugin-sample/ios/.gitignore | 1 + .../tauri-plugin-sample/ios/Package.swift | 4 +- .../cli/templates/plugin/android/.gitignore | 3 +- tooling/cli/templates/plugin/ios/.gitignore | 1 + .../cli/templates/plugin/ios/Package.swift | 5 +- 13 files changed, 292 insertions(+), 313 deletions(-) delete mode 100644 Package.swift delete mode 100644 core/tauri-build/templates/Package.swift diff --git a/.gitignore b/.gitignore index 346333f83..4fb1d3064 100644 --- a/.gitignore +++ b/.gitignore @@ -87,7 +87,3 @@ test_video.mp4 # old cli directories /tooling/cli.js /tooling/cli.rs - -# Swift -Package.resolved -.build diff --git a/Package.swift b/Package.swift deleted file mode 100644 index 40046faa0..000000000 --- a/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.7 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "TauriWorkspace", - products: [ - .library(name: "Tauri", targets: ["Tauri"]), - ], - dependencies: [ - .package(url: "https://github.com/Brendonovich/swift-rs", revision: "eb6de914ad57501da5019154d476d45660559999"), - ], - targets: [ - .target( - name: "Tauri", - dependencies: [ - .product(name: "SwiftRs", package: "swift-rs"), - ], - path: "core/tauri/mobile/ios-api/Sources/Tauri" - ), - .testTarget( - name: "TauriTests", - dependencies: ["Tauri"], - path: "core/tauri/mobile/ios-api/Tests/TauriTests" - ), - ] -) diff --git a/core/tauri-build/src/mobile.rs b/core/tauri-build/src/mobile.rs index 958b174c2..63ebdf505 100644 --- a/core/tauri-build/src/mobile.rs +++ b/core/tauri-build/src/mobile.rs @@ -1,5 +1,5 @@ use std::{ - env::var, + env::{var, var_os}, fs::{self, rename}, path::{Path, PathBuf}, }; @@ -36,16 +36,30 @@ impl PluginBuilder { match target_os.as_str() { "android" => { if let Some(path) = self.android_path { - let manifest_dir = var("CARGO_MANIFEST_DIR").map(PathBuf::from).unwrap(); + let manifest_dir = var_os("CARGO_MANIFEST_DIR").map(PathBuf::from).unwrap(); + let source = manifest_dir.join(path); + + let tauri_library_path = std::env::var("DEP_TAURI_ANDROID_LIBRARY_PATH") + .expect("missing `DEP_TAURI_ANDROID_LIBRARY_PATH` environment variable. Make sure `tauri` is a dependency of the plugin."); + + copy_folder( + Path::new(&tauri_library_path), + &source.join("tauri-api"), + &[], + )?; + if let Ok(project_dir) = var("TAURI_ANDROID_PROJECT_PATH") { - let source = manifest_dir.join(path); let pkg_name = var("CARGO_PKG_NAME").unwrap(); println!("cargo:rerun-if-env-changed=TAURI_ANDROID_PROJECT_PATH"); let project_dir = PathBuf::from(project_dir); - inject_android_project(source, project_dir.join("tauri-plugins").join(&pkg_name))?; + inject_android_project( + source, + project_dir.join("tauri-plugins").join(&pkg_name), + &["tauri-api"], + )?; let gradle_settings_path = project_dir.join("tauri.settings.gradle"); let gradle_settings = fs::read_to_string(&gradle_settings_path)?; @@ -76,22 +90,16 @@ project(':{pkg_name}').projectDir = new File('./tauri-plugins/{pkg_name}')" #[cfg(target_os = "macos")] "ios" => { if let Some(path) = self.ios_path { - let package_name = var("CARGO_PKG_NAME").unwrap(); + let manifest_dir = var_os("CARGO_MANIFEST_DIR").map(PathBuf::from).unwrap(); let tauri_library_path = std::env::var("DEP_TAURI_IOS_LIBRARY_PATH") .expect("missing `DEP_TAURI_IOS_LIBRARY_PATH` environment variable. Make sure `tauri` is a dependency of the plugin."); - let project_path = std::env::temp_dir().join(&package_name); - std::fs::create_dir_all(&project_path)?; - copy_folder(&path, &project_path.join("ios"))?; - - let package_swift_file = include_str!("../templates/Package.swift") - .replace("$PLUGIN_PACKAGE_NAME", &package_name) - .replace("$PLUGIN_PACKAGE_SRC_PATH", "ios/Sources") - .replace("$TAURI_PATH", &tauri_library_path); - - std::fs::write(project_path.join("Package.swift"), package_swift_file)?; - std::env::set_current_dir(&project_path)?; - link_swift_library(&var("CARGO_PKG_NAME").unwrap(), project_path); + copy_folder( + &Path::new(&tauri_library_path), + &path.join("tauri-api"), + &[".build", "Package.resolved", "Tests"], + )?; + link_swift_library(&var("CARGO_PKG_NAME").unwrap(), manifest_dir.join(path)); } } _ => (), @@ -106,14 +114,21 @@ project(':{pkg_name}').projectDir = new File('./tauri-plugins/{pkg_name}')" pub fn link_swift_library(name: &str, source: impl AsRef) { let source = source.as_ref(); println!("cargo:rerun-if-changed={}", source.display()); + let curr_dir = std::env::current_dir().unwrap(); + std::env::set_current_dir(&source).unwrap(); swift_rs::build::SwiftLinker::new("10.13") .with_ios("11") .with_package(name, source) .link(); + std::env::set_current_dir(&curr_dir).unwrap(); } #[doc(hidden)] -pub fn inject_android_project(source: impl AsRef, target: impl AsRef) -> Result<()> { +pub fn inject_android_project( + source: impl AsRef, + target: impl AsRef, + ignore_paths: &[&str], +) -> Result<()> { let source = source.as_ref(); let target = target.as_ref(); @@ -127,7 +142,7 @@ pub fn inject_android_project(source: impl AsRef, target: impl AsRef None }; - copy_folder(source, target)?; + copy_folder(source, target, ignore_paths)?; if let Some(out_dir) = out_dir { rename(out_dir, &build_path)?; @@ -136,12 +151,19 @@ pub fn inject_android_project(source: impl AsRef, target: impl AsRef Ok(()) } -fn copy_folder(source: &Path, target: &Path) -> Result<()> { +fn copy_folder(source: &Path, target: &Path, ignore_paths: &[&str]) -> Result<()> { let _ = fs::remove_dir_all(target); for entry in walkdir::WalkDir::new(source) { let entry = entry?; let rel_path = entry.path().strip_prefix(source)?; + let rel_path_str = rel_path.to_string_lossy(); + if ignore_paths + .iter() + .any(|path| rel_path_str.starts_with(path)) + { + continue; + } let dest_path = target.join(rel_path); if entry.file_type().is_dir() { fs::create_dir(dest_path)?; diff --git a/core/tauri-build/templates/Package.swift b/core/tauri-build/templates/Package.swift deleted file mode 100644 index 3ee73ac7f..000000000 --- a/core/tauri-build/templates/Package.swift +++ /dev/null @@ -1,23 +0,0 @@ -// swift-tools-version:5.7 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PluginWorkspace", - products: [ - .library(name: "$PLUGIN_PACKAGE_NAME", type: .static, targets: ["$PLUGIN_PACKAGE_NAME"]), - ], - dependencies: [ - .package(name: "Tauri", path: "$TAURI_PATH"), - ], - targets: [ - .target( - name: "$PLUGIN_PACKAGE_NAME", - dependencies: [ - .byName(name: "Tauri") - ], - path: "$PLUGIN_PACKAGE_SRC_PATH" - ), - ] -) diff --git a/core/tauri/build.rs b/core/tauri/build.rs index e46bd7eb5..ff985782b 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -150,16 +150,20 @@ fn main() { tauri_build::mobile::inject_android_project( "./mobile/android", project_dir.join("tauri-api"), + &[], ) .expect("failed to copy tauri-api Android project"); } + let lib_path = + PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("mobile/android"); + println!("cargo:android_library_path={}", lib_path.display()); } #[cfg(target_os = "macos")] { if target_os == "ios" { let lib_path = - PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("mobile/ios-api"); + PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("mobile/ios-api"); tauri_build::mobile::link_swift_library("Tauri", &lib_path); println!("cargo:ios_library_path={}", lib_path.display()); } diff --git a/core/tauri/mobile/ios-api/.gitignore b/core/tauri/mobile/ios-api/.gitignore index 3b2981208..5922fdaa5 100644 --- a/core/tauri/mobile/ios-api/.gitignore +++ b/core/tauri/mobile/ios-api/.gitignore @@ -7,3 +7,4 @@ DerivedData/ .swiftpm/config/registries.json .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .netrc +Package.resolved diff --git a/examples/api/src-tauri/tauri-plugin-sample/Cargo.lock b/examples/api/src-tauri/tauri-plugin-sample/Cargo.lock index 9dd0abc81..dce66ddb7 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/Cargo.lock +++ b/examples/api/src-tauri/tauri-plugin-sample/Cargo.lock @@ -32,24 +32,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android_log-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" - -[[package]] -name = "android_logger" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ec2333c185d826313162cee39d3fcc6a84ba08114a839bebf53b961e7e75773" -dependencies = [ - "android_log-sys", - "env_logger", - "lazy_static", - "log", -] - [[package]] name = "anyhow" version = "1.0.68" @@ -58,9 +40,9 @@ checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "atk" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +checksum = "39991bc421ddf72f70159011b323ff49b0f783cc676a7287c59453da2e2531cf" dependencies = [ "atk-sys", "bitflags", @@ -70,14 +52,14 @@ dependencies = [ [[package]] name = "atk-sys" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +checksum = "11ad703eb64dc058024f0e57ccfa069e15a413b98dbd50a1a950e743b7f11148" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.0.3", + "system-deps", ] [[package]] @@ -179,26 +161,37 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cairo-rs" -version = "0.15.12" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +checksum = "f3125b15ec28b84c238f6f476c6034016a5f6cc0221cb514ca46c532139fc97d" dependencies = [ "bitflags", "cairo-sys-rs", "glib", "libc", + "once_cell", "thiserror", ] [[package]] name = "cairo-sys-rs" -version = "0.15.1" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421" dependencies = [ "glib-sys", "libc", - "system-deps 6.0.3", + "system-deps", +] + +[[package]] +name = "cargo_toml" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497049e9477329f8f6a559972ee42e117487d01d1e8c2cc9f836ea6fa23a9e1a" +dependencies = [ + "serde", + "toml", ] [[package]] @@ -223,15 +216,6 @@ dependencies = [ "uuid 0.8.2", ] -[[package]] -name = "cfg-expr" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" -dependencies = [ - "smallvec", -] - [[package]] name = "cfg-expr" version = "0.11.0" @@ -466,19 +450,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dashmap" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -565,16 +536,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "log", - "regex", -] - [[package]] name = "fastrand" version = "1.8.0" @@ -730,9 +691,9 @@ dependencies = [ [[package]] name = "gdk" -version = "0.15.4" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +checksum = "aa9cb33da481c6c040404a11f8212d193889e9b435db2c14fd86987f630d3ce1" dependencies = [ "bitflags", "cairo-rs", @@ -746,9 +707,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.15.11" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +checksum = "c3578c60dee9d029ad86593ed88cb40f35c1b83360e12498d055022385dd9a05" dependencies = [ "bitflags", "gdk-pixbuf-sys", @@ -759,22 +720,22 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +checksum = "3092cf797a5f1210479ea38070d9ae8a5b8e9f8f1be9f32f4643c529c7d70016" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps 6.0.3", + "system-deps", ] [[package]] name = "gdk-sys" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +checksum = "d76354f97a913e55b984759a997b693aa7dc71068c9e98bcce51aa167a0a5c5a" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -784,19 +745,33 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.0.3", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4511710212ed3020b61a8622a37aa6f0dd2a84516575da92e9b96928dcbe83ba" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", ] [[package]] name = "gdkx11-sys" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +checksum = "9fa2bf8b5b8c414bc5d05e48b271896d0fd3ddb57464a3108438082da61de6af" dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps 6.0.3", + "system-deps", "x11", ] @@ -810,7 +785,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows", + "windows 0.39.0", ] [[package]] @@ -847,45 +822,50 @@ dependencies = [ [[package]] name = "gio" -version = "0.15.12" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +checksum = "2a1c84b4534a290a29160ef5c6eff2a9c95833111472e824fc5cb78b513dd092" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-io", + "futures-util", "gio-sys", "glib", "libc", "once_cell", + "pin-project-lite", + "smallvec", "thiserror", ] [[package]] name = "gio-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.0.3", + "system-deps", "winapi", ] [[package]] name = "glib" -version = "0.15.12" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +checksum = "ddd4df61a866ed7259d6189b8bcb1464989a77f1d85d25d002279bbe9dd38b2f" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", + "futures-util", + "gio-sys", "glib-macros", "glib-sys", "gobject-sys", @@ -897,12 +877,12 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.15.11" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +checksum = "e084807350b01348b6d9dbabb724d1a0bb987f47a2c85de200e98e12e30733bf" dependencies = [ "anyhow", - "heck 0.4.0", + "heck", "proc-macro-crate", "proc-macro-error", "proc-macro2", @@ -912,12 +892,12 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" dependencies = [ "libc", - "system-deps 6.0.3", + "system-deps", ] [[package]] @@ -941,20 +921,20 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" dependencies = [ "glib-sys", "libc", - "system-deps 6.0.3", + "system-deps", ] [[package]] name = "gtk" -version = "0.15.5" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +checksum = "e4d3507d43908c866c805f74c9dd593c0ce7ba5c38e576e41846639cdcd4bee6" dependencies = [ "atk", "bitflags", @@ -975,9 +955,9 @@ dependencies = [ [[package]] name = "gtk-sys" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +checksum = "89b5f8946685d5fe44497007786600c2f368ff6b1e61a16251c89f72a97520a3" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -988,14 +968,14 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps 6.0.3", + "system-deps", ] [[package]] name = "gtk3-macros" -version = "0.15.4" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +checksum = "8cfd6557b1018b773e43c8de9d0d13581d6b36190d0501916cbec4731db5ccff" dependencies = [ "anyhow", "proc-macro-crate", @@ -1011,15 +991,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.0" @@ -1165,9 +1136,9 @@ checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "javascriptcore-rs" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +checksum = "110b9902c80c12bf113c432d0b71c7a94490b294a8234f326fd0abca2fac0b00" dependencies = [ "bitflags", "glib", @@ -1176,14 +1147,14 @@ dependencies = [ [[package]] name = "javascriptcore-rs-sys" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +checksum = "98a216519a52cd941a733a0ad3f1023cfdb1cd47f3955e8e863ed56f558f916c" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 5.0.0", + "system-deps", ] [[package]] @@ -1497,17 +1468,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" -[[package]] -name = "oslog" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d2043d1f61d77cb2f4b1f7b7b2295f40507f5f8e9d1c8bf10a1ca5f97a3969" -dependencies = [ - "cc", - "dashmap", - "log", -] - [[package]] name = "overload" version = "0.1.1" @@ -1516,11 +1476,12 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pango" -version = "0.15.10" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +checksum = "cdff66b271861037b89d028656184059e03b0b6ccb36003820be19f7200b1e94" dependencies = [ "bitflags", + "gio", "glib", "libc", "once_cell", @@ -1529,14 +1490,14 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +checksum = "9e134909a9a293e04d2cc31928aa95679c5e4df954d0b85483159bd20d8f047f" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.0.3", + "system-deps", ] [[package]] @@ -1562,12 +1523,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - [[package]] name = "percent-encoding" version = "2.2.0" @@ -2196,31 +2151,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] -name = "soup2" -version = "0.2.1" +name = "soup3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +checksum = "82bc46048125fefd69d30b32b9d263d6556c9ffe82a7a7df181a86d912da5616" dependencies = [ "bitflags", + "futures-channel", "gio", "glib", "libc", "once_cell", - "soup2-sys", + "soup3-sys", ] [[package]] -name = "soup2-sys" -version = "0.2.0" +name = "soup3-sys" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +checksum = "014bbeb1c4cdb30739dc181e8d98b7908f124d9555843afa89b5570aaf4ec62b" dependencies = [ - "bitflags", "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps 5.0.0", + "system-deps", ] [[package]] @@ -2270,6 +2225,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "swift-rs" +version = "0.3.0" +source = "git+https://github.com/Brendonovich/swift-rs?rev=eb6de914ad57501da5019154d476d45660559999#eb6de914ad57501da5019154d476d45660559999" +dependencies = [ + "base64", + "serde", + "serde_json", +] + [[package]] name = "syn" version = "1.0.107" @@ -2281,37 +2246,23 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "system-deps" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" -dependencies = [ - "cfg-expr 0.9.1", - "heck 0.3.3", - "pkg-config", - "toml", - "version-compare 0.0.11", -] - [[package]] name = "system-deps" version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" dependencies = [ - "cfg-expr 0.11.0", - "heck 0.4.0", + "cfg-expr", + "heck", "pkg-config", "toml", - "version-compare 0.1.1", + "version-compare", ] [[package]] name = "tao" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704522803dda895767f69198af8351b0a3f4fe2e293c3ca54cce0ecba05a97f2" +version = "0.18.0" +source = "git+https://github.com/tauri-apps/tao?branch=dev#382ea30300b8e909cae5896b57c7c623c9825655" dependencies = [ "bitflags", "cairo-rs", @@ -2324,6 +2275,7 @@ dependencies = [ "gdk", "gdk-pixbuf", "gdk-sys", + "gdkwayland-sys", "gdkx11-sys", "gio", "glib", @@ -2347,17 +2299,16 @@ dependencies = [ "serde", "tao-macros", "unicode-segmentation", - "uuid 1.2.2", - "windows", + "uuid 1.3.0", + "windows 0.44.0", "windows-implement", "x11-dl", ] [[package]] name = "tao-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6fcd8245d45a39ffc8715183d92ae242750eb57b285eb3bcd63dfd512afd09" +version = "0.1.1" +source = "git+https://github.com/tauri-apps/tao?branch=dev#382ea30300b8e909cae5896b57c7c623c9825655" dependencies = [ "proc-macro2", "quote", @@ -2377,9 +2328,8 @@ dependencies = [ [[package]] name = "tauri" -version = "2.0.0-alpha.2" +version = "2.0.0-alpha.3" dependencies = [ - "android_logger", "anyhow", "attohttpc", "cocoa", @@ -2391,15 +2341,14 @@ dependencies = [ "glib", "glob", "gtk", - "heck 0.4.0", + "heck", "http", "ignore", + "jni", "libc", "log", "objc", "once_cell", - "oslog", - "paste", "percent-encoding", "rand 0.8.5", "raw-window-handle", @@ -2409,7 +2358,9 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "state", + "swift-rs", "tar", + "tauri-build", "tauri-macros", "tauri-runtime", "tauri-runtime-wry", @@ -2418,15 +2369,31 @@ dependencies = [ "thiserror", "tokio", "url", - "uuid 1.2.2", + "uuid 1.3.0", "webkit2gtk", "webview2-com", - "windows", + "windows 0.44.0", +] + +[[package]] +name = "tauri-build" +version = "2.0.0-alpha.1" +dependencies = [ + "anyhow", + "cargo_toml", + "heck", + "json-patch", + "semver 1.0.16", + "serde_json", + "swift-rs", + "tauri-utils", + "walkdir", + "winres", ] [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.0" +version = "2.0.0-alpha.1" dependencies = [ "base64", "brotli", @@ -2444,15 +2411,15 @@ dependencies = [ "thiserror", "time", "url", - "uuid 1.2.2", + "uuid 1.3.0", "walkdir", ] [[package]] name = "tauri-macros" -version = "2.0.0-alpha.0" +version = "2.0.0-alpha.1" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "syn", @@ -2464,13 +2431,14 @@ dependencies = [ name = "tauri-plugin-sample" version = "0.1.0" dependencies = [ + "log", "tauri", - "walkdir", + "tauri-build", ] [[package]] name = "tauri-runtime" -version = "0.13.0-alpha.0" +version = "0.13.0-alpha.1" dependencies = [ "gtk", "http", @@ -2482,14 +2450,14 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "uuid 1.2.2", + "uuid 1.3.0", "webview2-com", - "windows", + "windows 0.44.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.13.0-alpha.0" +version = "0.13.0-alpha.1" dependencies = [ "cocoa", "gtk", @@ -2499,21 +2467,21 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.2.2", + "uuid 1.3.0", "webkit2gtk", "webview2-com", - "windows", + "windows 0.44.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0-alpha.0" +version = "2.0.0-alpha.1" dependencies = [ "brotli", "ctor", "glob", - "heck 0.4.0", + "heck", "html5ever", "infer", "json-patch", @@ -2529,7 +2497,7 @@ dependencies = [ "thiserror", "url", "walkdir", - "windows", + "windows 0.44.0", ] [[package]] @@ -2793,9 +2761,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom 0.2.8", ] @@ -2806,12 +2774,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "version-compare" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" - [[package]] name = "version-compare" version = "0.1.1" @@ -2849,9 +2811,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webkit2gtk" -version = "0.18.2" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +checksum = "d8eea819afe15eb8dcdff4f19d8bfda540bae84d874c10e6f4b8faf2d6704bd1" dependencies = [ "bitflags", "cairo-rs", @@ -2867,20 +2829,18 @@ dependencies = [ "javascriptcore-rs", "libc", "once_cell", - "soup2", + "soup3", "webkit2gtk-sys", ] [[package]] name = "webkit2gtk-sys" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +checksum = "d0ac7a95ddd3fdfcaf83d8e513b4b1ad101b95b413b6aa6662ed95f284fc3d5b" dependencies = [ - "atk-sys", "bitflags", "cairo-sys-rs", - "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", @@ -2888,21 +2848,20 @@ dependencies = [ "gtk-sys", "javascriptcore-rs-sys", "libc", - "pango-sys", "pkg-config", - "soup2-sys", - "system-deps 6.0.3", + "soup3-sys", + "system-deps", ] [[package]] name = "webview2-com" -version = "0.19.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +checksum = "03411e89ec447e29c08b3c086edeb88c5f8fd782cbdd4d6d316bea439be7a244" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows", + "windows 0.44.0", "windows-implement", ] @@ -2919,15 +2878,15 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +checksum = "1c0f5ce43e9611c5b2983a33156d6abe31abf39185bad84a6766c80ba1dbf1ab" dependencies = [ "regex", "serde", "serde_json", "thiserror", - "windows", + "windows 0.44.0", "windows-bindgen", "windows-metadata", ] @@ -2969,7 +2928,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" dependencies = [ - "windows-implement", "windows_aarch64_msvc 0.39.0", "windows_i686_gnu 0.39.0", "windows_i686_msvc 0.39.0", @@ -2978,10 +2936,21 @@ dependencies = [ ] [[package]] -name = "windows-bindgen" -version = "0.39.0" +name = "windows" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-targets", +] + +[[package]] +name = "windows-bindgen" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222204ecf46521382a4d88b4a1bbefca9f8855697b4ab7d20803901425e061a3" dependencies = [ "windows-metadata", "windows-tokens", @@ -2989,19 +2958,31 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.39.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" +dependencies = [ + "proc-macro2", + "quote", "syn", - "windows-tokens", ] [[package]] name = "windows-metadata" -version = "0.39.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" +checksum = "ee78911e3f4ce32c1ad9d3c7b0bd95389662ad8d8f1a3155688fed70bd96e2b6" [[package]] name = "windows-sys" @@ -3019,10 +3000,25 @@ dependencies = [ ] [[package]] -name = "windows-tokens" -version = "0.39.0" +name = "windows-targets" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-tokens" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4251900975a0d10841c5d4bde79c56681543367ef811f3fabb8d1803b0959b" [[package]] name = "windows_aarch64_gnullvm" @@ -3096,9 +3092,19 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml", +] + [[package]] name = "wry" -version = "0.24.1" +version = "0.26.0" +source = "git+https://github.com/tauri-apps/wry?branch=dev#077eb3a7ca520d07e73f899da60ce23eef941e6f" dependencies = [ "base64", "block", @@ -3121,14 +3127,14 @@ dependencies = [ "serde", "serde_json", "sha2", - "soup2", + "soup3", "tao", "thiserror", "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows", + "windows 0.44.0", "windows-implement", ] @@ -3144,12 +3150,12 @@ dependencies = [ [[package]] name = "x11-dl" -version = "2.20.1" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" dependencies = [ - "lazy_static", "libc", + "once_cell", "pkg-config", ] diff --git a/examples/api/src-tauri/tauri-plugin-sample/android/.gitignore b/examples/api/src-tauri/tauri-plugin-sample/android/.gitignore index 42afabfd2..fb9b198bc 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/android/.gitignore +++ b/examples/api/src-tauri/tauri-plugin-sample/android/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +/tauri-api diff --git a/examples/api/src-tauri/tauri-plugin-sample/ios/.gitignore b/examples/api/src-tauri/tauri-plugin-sample/ios/.gitignore index 5922fdaa5..7d98e3ad0 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/ios/.gitignore +++ b/examples/api/src-tauri/tauri-plugin-sample/ios/.gitignore @@ -8,3 +8,4 @@ DerivedData/ .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .netrc Package.resolved +/tauri-api diff --git a/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift b/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift index 2d9d1b662..b663d764e 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift +++ b/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift @@ -17,8 +17,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - //.package(url: "https://github.com/tauri-apps/tauri", branch: "next"), - .package(name: "Tauri", path: "../../../../../core/tauri/mobile/ios-api") + .package(name: "Tauri", path: "./tauri-api") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -26,7 +25,6 @@ let package = Package( .target( name: "tauri-plugin-sample", dependencies: [ - //.product(name: "Tauri", package: "tauri"), .byName(name: "Tauri") ], path: "Sources") diff --git a/tooling/cli/templates/plugin/android/.gitignore b/tooling/cli/templates/plugin/android/.gitignore index 42afabfd2..fb9b198bc 100644 --- a/tooling/cli/templates/plugin/android/.gitignore +++ b/tooling/cli/templates/plugin/android/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +/tauri-api diff --git a/tooling/cli/templates/plugin/ios/.gitignore b/tooling/cli/templates/plugin/ios/.gitignore index 5922fdaa5..7d98e3ad0 100644 --- a/tooling/cli/templates/plugin/ios/.gitignore +++ b/tooling/cli/templates/plugin/ios/.gitignore @@ -8,3 +8,4 @@ DerivedData/ .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .netrc Package.resolved +/tauri-api diff --git a/tooling/cli/templates/plugin/ios/Package.swift b/tooling/cli/templates/plugin/ios/Package.swift index fd66eb07f..13e786512 100644 --- a/tooling/cli/templates/plugin/ios/Package.swift +++ b/tooling/cli/templates/plugin/ios/Package.swift @@ -16,8 +16,7 @@ let package = Package( targets: ["tauri-plugin-{{ plugin_name }}"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/tauri-apps/tauri", branch: "next"), + .package(name: "Tauri", path: "./tauri-api") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -25,7 +24,7 @@ let package = Package( .target( name: "tauri-plugin-{{ plugin_name }}", dependencies: [ - .product(name: "Tauri", package: "tauri") + .byName(name: "Tauri") ], path: "Sources") ]