mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
device run implemented
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -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",
|
||||
|
||||
@@ -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<ConfigValue>,
|
||||
/// 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<String>) -> Result<Vec<&'a Target<'a>>> {
|
||||
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::<Vec<String>>()
|
||||
.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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user