diff --git a/cli/src/android/build.ts b/cli/src/android/build.ts index de22a2ded1..79503501b3 100644 --- a/cli/src/android/build.ts +++ b/cli/src/android/build.ts @@ -13,7 +13,10 @@ export async function buildAndroid( ): Promise { const releaseType = buildOptions.androidreleasetype ?? 'AAB'; const releaseTypeIsAAB = releaseType === 'AAB'; - const arg = releaseTypeIsAAB ? ':app:bundleRelease' : 'assembleRelease'; + const flavor = buildOptions.flavor ?? ''; + const arg = releaseTypeIsAAB + ? `:app:bundle${flavor}Release` + : `assemble${flavor}Release`; const gradleArgs = [arg]; if ( @@ -46,7 +49,7 @@ export async function buildAndroid( 'build', 'outputs', releaseTypeIsAAB ? 'bundle' : 'apk', - 'release', + buildOptions.flavor ? `${flavor}Release` : 'release', ); const unsignedReleaseName = `app${ diff --git a/cli/src/index.ts b/cli/src/index.ts index 3fbe893703..87b4c17876 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -141,6 +141,7 @@ export function runProgram(config: Config): void { .command('build ') .description('builds the release version of the selected platform') .option('--scheme ', 'iOS Scheme to build') + .option('--flavor ', 'Android Flavor to build') .option('--keystorepath ', 'Path to the keystore') .option('--keystorepass ', 'Password to the keystore') .option('--keystorealias ', 'Key Alias in the keystore') diff --git a/cli/src/tasks/build.ts b/cli/src/tasks/build.ts index 9522fa56ef..9a108c9e0c 100644 --- a/cli/src/tasks/build.ts +++ b/cli/src/tasks/build.ts @@ -6,6 +6,7 @@ import { buildiOS } from '../ios/build'; export interface BuildCommandOptions { scheme?: string; + flavor?: string; keystorepath?: string; keystorepass?: string; keystorealias?: string; @@ -31,6 +32,7 @@ export async function buildCommand( const buildCommandOptions: BuildCommandOptions = { scheme: buildOptions.scheme || config.ios.scheme, + flavor: buildOptions.flavor || config.android.flavor, keystorepath: buildOptions.keystorepath || config.android.buildOptions.keystorePath, keystorepass: