Browse Source

fix(ios): correctly use lib-name field

Lucas Nogueira 2 năm trước cách đây
mục cha
commit
2b22f64972

+ 9 - 3
tooling/cli/src/mobile/mod.rs

@@ -275,12 +275,18 @@ fn get_app(config: &TauriConfig) -> App {
   )
   .expect("failed to load interface");
 
-  let app_name = interface.app_settings().app_name().unwrap_or(app_name);
-  let lib_name = interface.app_settings().lib_name();
+  let app_name = interface
+    .app_settings()
+    .app_name()
+    .unwrap_or(app_name.clone());
+  let lib_name = interface
+    .app_settings()
+    .lib_name()
+    .unwrap_or(app_name.clone());
 
   let raw = RawAppConfig {
     name: app_name,
-    lib_name,
+    lib_name: Some(lib_name),
     stylized_name: config.package.product_name.clone(),
     domain,
     asset_dir: None,

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

@@ -78,7 +78,7 @@ targets:
         ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true
       groups: [app]
     dependencies:
-      - framework: lib{{app.lib_name}}.a
+      - framework: lib{{app.lib-name}}.a
         embed: false
       {{~#each ios-libraries}}
       - framework: {{this}}
@@ -120,8 +120,8 @@ targets:
         name: Build Rust Code
         basedOnDependencyAnalysis: false
         outputFiles:
-          - $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib_name}}.a
-          - $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib_name}}.a
+          - $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib-name}}.a
+          - $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib-name}}.a
     {{~#if ios-post-compile-scripts}}
     postCompileScripts:
       {{~#each ios-post-compile-scripts}}{{#if this.path}}