Skip to content

Commit 62aa13a

Browse files
fix(cli): Android build --apk and --aab flags requiring a value (#14629)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
1 parent e919a76 commit 62aa13a

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Fix `android build`'s `--aab` and `--apk` flags requiring a value to be provided.

crates/tauri-cli/src/mobile/android/build.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ pub struct Options {
6464
pub split_per_abi: bool,
6565
/// Build APKs.
6666
#[clap(long)]
67-
pub apk: Option<bool>,
67+
pub apk: bool,
6868
/// Build AABs.
6969
#[clap(long)]
70-
pub aab: Option<bool>,
70+
pub aab: bool,
71+
#[clap(skip)]
72+
pub skip_bundle: bool,
7173
/// Open Android Studio
7274
#[clap(short, long)]
7375
pub open: bool,
@@ -242,10 +244,10 @@ fn run_build(
242244
noise_level: NoiseLevel,
243245
tauri_dir: &Path,
244246
) -> Result<OptionsHandle> {
245-
if !(options.apk.is_some() || options.aab.is_some()) {
247+
if !(options.skip_bundle || options.apk || options.aab) {
246248
// if the user didn't specify the format to build, we'll do both
247-
options.apk = Some(true);
248-
options.aab = Some(true);
249+
options.apk = true;
250+
options.aab = true;
249251
}
250252

251253
let interface_options = InterfaceOptions {
@@ -272,7 +274,7 @@ fn run_build(
272274

273275
inject_resources(config, tauri_config)?;
274276

275-
let apk_outputs = if options.apk.unwrap_or_default() {
277+
let apk_outputs = if options.apk {
276278
apk::build(
277279
config,
278280
env,
@@ -286,7 +288,7 @@ fn run_build(
286288
Vec::new()
287289
};
288290

289-
let aab_outputs = if options.aab.unwrap_or_default() {
291+
let aab_outputs = if options.aab {
290292
aab::build(
291293
config,
292294
env,

crates/tauri-cli/src/mobile/android/run.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
101101
features: options.features,
102102
config: options.config.clone(),
103103
split_per_abi: true,
104-
apk: Some(false),
105-
aab: Some(false),
104+
apk: false,
105+
aab: false,
106+
skip_bundle: false,
106107
open: options.open,
107108
ci: false,
108109
args: options.args,

0 commit comments

Comments
 (0)