From 54dbfdac048daf76ab6d8a4af4cb7b5a5cf0d6bd Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 20 Aug 2025 08:46:57 -0300 Subject: [PATCH] device run implemented --- Cargo.lock | 2 +- .../src/mobile/open_harmony/build.rs | 40 +------------------ 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 789ae2ade..b2b5ad22a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1058,7 +1058,7 @@ dependencies = [ [[package]] name = "cargo-mobile2" version = "0.20.4" -source = "git+https://github.com/tauri-apps/cargo-mobile2?branch=feat/ohos#2f415dd3fb09b883165b689237f8826aa34f2f4d" +source = "git+https://github.com/tauri-apps/cargo-mobile2?branch=feat/ohos#c0e0c20ce4064dcebc0f49cf4c3c5386063295ad" dependencies = [ "colored", "core-foundation 0.10.0", diff --git a/crates/tauri-cli/src/mobile/open_harmony/build.rs b/crates/tauri-cli/src/mobile/open_harmony/build.rs index f197ddcff..674b5849d 100644 --- a/crates/tauri-cli/src/mobile/open_harmony/build.rs +++ b/crates/tauri-cli/src/mobile/open_harmony/build.rs @@ -58,9 +58,6 @@ pub struct Options { /// but you can use this for more specific use cases such as different build flavors. #[clap(short, long)] pub config: Vec, - /// Whether to split the HAPs per ABIs. - #[clap(long)] - pub split_per_abi: bool, /// Open DevEco Studio #[clap(short, long)] pub open: bool, @@ -185,7 +182,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { #[allow(clippy::too_many_arguments)] fn run_build( interface: AppInterface, - options: Options, + _options: Options, build_options: BuildOptions, tauri_config: ConfigHandle, profile: Profile, @@ -217,42 +214,9 @@ fn run_build( inject_resources(config, tauri_config.lock().unwrap().as_ref().unwrap())?; - let hap_outputs = hap::build( - config, - env, - noise_level, - profile, - get_targets_or_all(options.targets.clone().unwrap_or_default())?, - options.split_per_abi, - )?; + let hap_outputs = hap::build(config, env, noise_level, profile)?; log_finished(hap_outputs, "HAP"); Ok(handle) } - -fn get_targets_or_all<'a>(targets: Vec) -> Result>> { - if targets.is_empty() { - Ok(Target::all().iter().map(|t| t.1).collect()) - } else { - let mut outs = Vec::new(); - - let possible_targets = Target::all() - .keys() - .map(|key| key.to_string()) - .collect::>() - .join(","); - - for t in targets { - let target = Target::for_name(&t).ok_or_else(|| { - anyhow::anyhow!( - "Target {} is invalid; the possible targets are {}", - t, - possible_targets - ) - })?; - outs.push(target); - } - Ok(outs) - } -}