From abc5f91fa3569efc9dfdee46d1c501eda8755944 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 13 Apr 2023 14:26:32 -0700 Subject: [PATCH] fix(cli): iOS Xcode script using incorrect library path (#6699) --- .changes/fix-xcodescript-lib-path.md | 6 ++++++ tooling/cli/src/mobile/ios/xcode_script.rs | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .changes/fix-xcodescript-lib-path.md diff --git a/.changes/fix-xcodescript-lib-path.md b/.changes/fix-xcodescript-lib-path.md new file mode 100644 index 000000000..5c435cbcc --- /dev/null +++ b/.changes/fix-xcodescript-lib-path.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Fixes iOS build script using the wrong path for the app library file. diff --git a/tooling/cli/src/mobile/ios/xcode_script.rs b/tooling/cli/src/mobile/ios/xcode_script.rs index f2e997b1b..6c88db30e 100644 --- a/tooling/cli/src/mobile/ios/xcode_script.rs +++ b/tooling/cli/src/mobile/ios/xcode_script.rs @@ -4,7 +4,7 @@ use super::{env, with_config}; use crate::{ - helpers::config::get as get_config, + helpers::{app_paths::tauri_dir, config::get as get_config}, interface::{AppInterface, AppSettings, Interface, Options as InterfaceOptions}, Result, }; @@ -200,17 +200,19 @@ pub fn command(options: Options) -> Result<()> { if !lib_path.exists() { return Err(anyhow::anyhow!("Library not found at {}. Make sure your Cargo.toml file has a [lib] block with `crate-type = [\"staticlib\", \"cdylib\", \"rlib\"]`", lib_path.display())); } - std::fs::create_dir_all(format!( + + let tauri_path = tauri_dir(); + std::fs::create_dir_all(tauri_path.join(format!( "gen/apple/Externals/{}", profile.as_str() - ))?; + )))?; std::fs::copy( lib_path, - format!( + tauri_path.join(format!( "gen/apple/Externals/{}/lib{}.a", profile.as_str(), config.app().lib_name() - ), + )) )?; } Ok(())