mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 11:41:56 +00:00
fix(cli): Android build --apk and --aab flags requiring a value (#14629)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
parent
e919a760ed
commit
62aa13a124
6
.changes/fix-android-bundle-flag.md
Normal file
6
.changes/fix-android-bundle-flag.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"tauri-cli": patch:bug
|
||||||
|
"@tauri-apps/cli": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix `android build`'s `--aab` and `--apk` flags requiring a value to be provided.
|
||||||
@ -64,10 +64,12 @@ pub struct Options {
|
|||||||
pub split_per_abi: bool,
|
pub split_per_abi: bool,
|
||||||
/// Build APKs.
|
/// Build APKs.
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
pub apk: Option<bool>,
|
pub apk: bool,
|
||||||
/// Build AABs.
|
/// Build AABs.
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
pub aab: Option<bool>,
|
pub aab: bool,
|
||||||
|
#[clap(skip)]
|
||||||
|
pub skip_bundle: bool,
|
||||||
/// Open Android Studio
|
/// Open Android Studio
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
pub open: bool,
|
pub open: bool,
|
||||||
@ -242,10 +244,10 @@ fn run_build(
|
|||||||
noise_level: NoiseLevel,
|
noise_level: NoiseLevel,
|
||||||
tauri_dir: &Path,
|
tauri_dir: &Path,
|
||||||
) -> Result<OptionsHandle> {
|
) -> Result<OptionsHandle> {
|
||||||
if !(options.apk.is_some() || options.aab.is_some()) {
|
if !(options.skip_bundle || options.apk || options.aab) {
|
||||||
// if the user didn't specify the format to build, we'll do both
|
// if the user didn't specify the format to build, we'll do both
|
||||||
options.apk = Some(true);
|
options.apk = true;
|
||||||
options.aab = Some(true);
|
options.aab = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let interface_options = InterfaceOptions {
|
let interface_options = InterfaceOptions {
|
||||||
@ -272,7 +274,7 @@ fn run_build(
|
|||||||
|
|
||||||
inject_resources(config, tauri_config)?;
|
inject_resources(config, tauri_config)?;
|
||||||
|
|
||||||
let apk_outputs = if options.apk.unwrap_or_default() {
|
let apk_outputs = if options.apk {
|
||||||
apk::build(
|
apk::build(
|
||||||
config,
|
config,
|
||||||
env,
|
env,
|
||||||
@ -286,7 +288,7 @@ fn run_build(
|
|||||||
Vec::new()
|
Vec::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
let aab_outputs = if options.aab.unwrap_or_default() {
|
let aab_outputs = if options.aab {
|
||||||
aab::build(
|
aab::build(
|
||||||
config,
|
config,
|
||||||
env,
|
env,
|
||||||
|
|||||||
@ -101,8 +101,9 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
|
|||||||
features: options.features,
|
features: options.features,
|
||||||
config: options.config.clone(),
|
config: options.config.clone(),
|
||||||
split_per_abi: true,
|
split_per_abi: true,
|
||||||
apk: Some(false),
|
apk: false,
|
||||||
aab: Some(false),
|
aab: false,
|
||||||
|
skip_bundle: false,
|
||||||
open: options.open,
|
open: options.open,
|
||||||
ci: false,
|
ci: false,
|
||||||
args: options.args,
|
args: options.args,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user