@@ -183,10 +183,10 @@ impl std::str::FromStr for Format {
183
183
}
184
184
185
185
impl Format {
186
- pub fn platform_default ( platform : Platform , opt : Opt ) -> Self {
186
+ pub fn platform_default ( platform : Platform , opt : Opt , gradle : bool ) -> Self {
187
187
match ( platform, opt) {
188
- ( Platform :: Android , Opt :: Debug ) => Self :: Apk ,
189
- ( Platform :: Android , Opt :: Release ) => Self :: Aab ,
188
+ ( Platform :: Android , Opt :: Release ) if gradle => Self :: Aab ,
189
+ ( Platform :: Android , _ ) => Self :: Apk ,
190
190
( Platform :: Ios , Opt :: Debug ) => Self :: Appbundle ,
191
191
( Platform :: Ios , Opt :: Release ) => Self :: Ipa ,
192
192
( Platform :: Linux , Opt :: Debug ) => Self :: Appdir ,
@@ -410,7 +410,7 @@ pub struct BuildTargetArgs {
410
410
}
411
411
412
412
impl BuildTargetArgs {
413
- pub fn build_target ( self ) -> Result < BuildTarget > {
413
+ pub fn build_target ( self , config : & Config ) -> Result < BuildTarget > {
414
414
let signer = if let Some ( pem) = self . pem . as_ref ( ) {
415
415
anyhow:: ensure!( pem. exists( ) , "pem file doesn't exist {}" , pem. display( ) ) ;
416
416
Some ( Signer :: from_path ( pem) ?)
@@ -463,7 +463,7 @@ impl BuildTargetArgs {
463
463
} else if store == Some ( Store :: Play ) {
464
464
Format :: Aab
465
465
} else {
466
- Format :: platform_default ( platform, opt)
466
+ Format :: platform_default ( platform, opt, config . android ( ) . gradle )
467
467
} ;
468
468
let provisioning_profile = if let Some ( profile) = self . provisioning_profile {
469
469
anyhow:: ensure!(
@@ -574,12 +574,12 @@ impl BuildEnv {
574
574
let verbose = args. verbose ;
575
575
let offline = args. cargo . offline ;
576
576
let cargo = args. cargo . cargo ( ) ?;
577
- let build_target = args. build_target . build_target ( ) ?;
578
577
let build_dir = cargo. target_dir ( ) . join ( "x" ) ;
579
578
let cache_dir = dirs:: cache_dir ( ) . unwrap ( ) . join ( "x" ) ;
580
579
let package = cargo. manifest ( ) . package . as_ref ( ) . unwrap ( ) ; // Caller should guarantee that this is a valid package
581
580
let manifest = cargo. package_root ( ) . join ( "manifest.yaml" ) ;
582
581
let mut config = Config :: parse ( manifest) ?;
582
+ let build_target = args. build_target . build_target ( & config) ?;
583
583
config. apply_rust_package ( package, cargo. workspace_manifest ( ) , build_target. opt ( ) ) ?;
584
584
let icon = config
585
585
. icon ( build_target. platform ( ) )
0 commit comments