mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-28 20:48:52 +03:00
fix(cli/android): fallback to all targets (#7028)
fix regression introduced in d03e47d141
This commit is contained in:
parent
aa6c9164e6
commit
3f4c4ce88b
5
.changes/cli-android-split-per-abit-target.md
Normal file
5
.changes/cli-android-split-per-abit-target.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'cli.rs': 'patch'
|
||||
---
|
||||
|
||||
Fix `--split-per-abi` not building any targets unless specified by `--target` flag.
|
@ -186,7 +186,7 @@ fn run_build(
|
||||
env,
|
||||
noise_level,
|
||||
profile,
|
||||
get_targets(options.targets.clone().unwrap_or_default())?,
|
||||
get_targets_or_all(options.targets.clone().unwrap_or_default())?,
|
||||
options.split_per_abi,
|
||||
)?
|
||||
} else {
|
||||
@ -199,7 +199,7 @@ fn run_build(
|
||||
env,
|
||||
noise_level,
|
||||
profile,
|
||||
get_targets(options.targets.unwrap_or_default())?,
|
||||
get_targets_or_all(options.targets.unwrap_or_default())?,
|
||||
options.split_per_abi,
|
||||
)?
|
||||
} else {
|
||||
@ -212,24 +212,28 @@ fn run_build(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_targets<'a>(targets: Vec<String>) -> Result<Vec<&'a Target<'a>>> {
|
||||
let mut outs = Vec::new();
|
||||
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(",");
|
||||
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);
|
||||
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)
|
||||
}
|
||||
Ok(outs)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user