Преглед изворни кода

fix(cli): adjust iOS project to work on simulator again (#6349)

Lucas Fernandes Nogueira пре 2 година
родитељ
комит
d11af5be8d

+ 2 - 2
core/tauri/src/window.rs

@@ -1510,8 +1510,8 @@ impl<R: Runtime> Window<R> {
                       .as_str()
                       .into(),
                     crate::ios::json_to_dictionary(message.payload),
-                    resolver.callback.0,
-                    resolver.error.0,
+                    callback.0,
+                    error.0,
                   )
                 };
               })?;

+ 6 - 29
examples/api/src-tauri/Cargo.lock

@@ -612,19 +612,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 = "dbus"
 version = "0.9.7"
@@ -1283,9 +1270,9 @@ dependencies = [
 
 [[package]]
 name = "http"
-version = "0.2.8"
+version = "0.2.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
+checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
 dependencies = [
  "bytes",
  "fnv",
@@ -2007,17 +1994,6 @@ version = "6.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
 
-[[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"
@@ -3149,17 +3125,18 @@ dependencies = [
 [[package]]
 name = "tauri-plugin-log"
 version = "0.1.0"
-source = "git+https://github.com/tauri-apps/plugins-workspace?branch=next#22f987bf240f8db634f8fa3338bcc15792b9cb3a"
+source = "git+https://github.com/tauri-apps/plugins-workspace?branch=next#961602bd1b15e9c0d83d4c32c221a075fbabd83b"
 dependencies = [
  "android_logger",
  "byte-unit",
  "fern",
  "log",
- "oslog",
  "serde",
  "serde_json",
  "serde_repr",
+ "swift-rs",
  "tauri",
+ "tauri-build",
  "time",
 ]
 
@@ -4134,7 +4111,7 @@ dependencies = [
 [[package]]
 name = "wry"
 version = "0.27.0"
-source = "git+https://github.com/tauri-apps/wry?branch=dev#9975dda12a122051b375ec6485650546d2d91c26"
+source = "git+https://github.com/tauri-apps/wry?branch=dev#7795356a45b1bd015fad0e9973fc5af58c8c339b"
 dependencies = [
  "base64 0.13.1",
  "block",

+ 1 - 0
examples/api/src-tauri/Cargo.toml

@@ -22,6 +22,7 @@ tauri-plugin-sample = { path = "./tauri-plugin-sample/" }
 
 [patch.'https://github.com/tauri-apps/tauri']
 tauri = { path = "../../../core/tauri" }
+tauri-build = { path = "../../../core/tauri-build" }
 
 [dependencies.tauri]
 path = "../../../core/tauri"

+ 1 - 0
tooling/cli/src/mobile/ios/build.rs

@@ -116,6 +116,7 @@ fn run_build(
   let app_settings = interface.app_settings();
   let bin_path = app_settings.app_binary_path(&InterfaceOptions {
     debug: build_options.debug,
+    target: build_options.target.clone(),
     ..Default::default()
   })?;
   let out_dir = bin_path.parent().unwrap();

+ 1 - 0
tooling/cli/src/mobile/ios/dev.rs

@@ -141,6 +141,7 @@ fn run_dev(
   let app_settings = interface.app_settings();
   let bin_path = app_settings.app_binary_path(&InterfaceOptions {
     debug: !dev_options.release_mode,
+    target: dev_options.target.clone(),
     ..Default::default()
   })?;
   let out_dir = bin_path.parent().unwrap();

+ 0 - 3
tooling/cli/templates/mobile/ios/Sources/Tauri.swift

@@ -1,3 +0,0 @@
-// This dummy file is required for the project to work with Swift libraries.
-
-import Foundation

+ 3 - 3
tooling/cli/templates/mobile/ios/project.yml

@@ -72,9 +72,9 @@ targets:
         ENABLE_BITCODE: false
         ARCHS: [{{join ios-valid-archs}}]
         VALID_ARCHS: {{~#each ios-valid-archs}} {{this}} {{/each}}
-        LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64-apple-ios/$(CONFIGURATION) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
-        LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/aarch64-apple-ios/$(CONFIGURATION) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
-        LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/aarch64-apple-ios-sim/$(CONFIGURATION) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
+        LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64-apple-ios/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
+        LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/aarch64-apple-ios/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
+        LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/aarch64-apple-ios-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
         ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true
       groups: [app]
     dependencies: