fix(cli): `ios xcode-script` arg parsing when using bun, closes #10742 (#11100)

This commit is contained in:
Lucas Fernandes Nogueira 2024-09-23 18:31:29 -03:00 committed by GitHub
parent d369e8db5f
commit 56e087471a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 13 deletions

View File

@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---
Fix iOS xcode-script usage with `bun`.

View File

@ -12,7 +12,7 @@ use crate::{
use anyhow::Context;
use cargo_mobile2::{apple::target::Target, opts::Profile};
use clap::Parser;
use clap::{ArgAction, Parser};
use object::{Object, ObjectSymbol};
use std::{
@ -33,14 +33,14 @@ pub struct Options {
#[clap(long)]
sdk_root: PathBuf,
/// Value of `FRAMEWORK_SEARCH_PATHS` env var
#[clap(long)]
framework_search_paths: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
framework_search_paths: Vec<String>,
/// Value of `GCC_PREPROCESSOR_DEFINITIONS` env var
#[clap(long)]
gcc_preprocessor_definitions: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
gcc_preprocessor_definitions: Vec<String>,
/// Value of `HEADER_SEARCH_PATHS` env var
#[clap(long)]
header_search_paths: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
header_search_paths: Vec<String>,
/// Value of `CONFIGURATION` env var
#[clap(long)]
configuration: String,
@ -149,15 +149,17 @@ pub fn command(options: Options) -> Result<()> {
include_dir.as_os_str(),
);
host_env.insert(
"FRAMEWORK_SEARCH_PATHS",
options.framework_search_paths.as_ref(),
);
let framework_search_paths = options.framework_search_paths.join(" ");
host_env.insert("FRAMEWORK_SEARCH_PATHS", framework_search_paths.as_ref());
let gcc_preprocessor_definitions = options.gcc_preprocessor_definitions.join(" ");
host_env.insert(
"GCC_PREPROCESSOR_DEFINITIONS",
options.gcc_preprocessor_definitions.as_ref(),
gcc_preprocessor_definitions.as_ref(),
);
host_env.insert("HEADER_SEARCH_PATHS", options.header_search_paths.as_ref());
let header_search_paths = options.header_search_paths.join(" ");
host_env.insert("HEADER_SEARCH_PATHS", header_search_paths.as_ref());
let macos_target = Target::macos();