Skip to content

Commit

Permalink
fix(cli): iOS Xcode script using incorrect library path (#6699)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Apr 13, 2023
1 parent 57fa569 commit abc5f91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-xcodescript-lib-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---

Fixes iOS build script using the wrong path for the app library file.
12 changes: 7 additions & 5 deletions tooling/cli/src/mobile/ios/xcode_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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(())
Expand Down

0 comments on commit abc5f91

Please sign in to comment.