Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[xdl] remove build flavors from android build commands for SDK >= 33
Browse files Browse the repository at this point in the history
  • Loading branch information
esamelson committed Feb 1, 2019
1 parent 5289050 commit 3ca73ce
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions packages/xdl/src/detach/AndroidShellApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@ async function buildShellAppAsync(context: StandaloneContext, sdkVersion: string
await fs.remove(`shell.apk`);
} catch (e) {}
let gradleBuildCommand;
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
gradleBuildCommand = 'assembleRelease';
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
gradleBuildCommand = 'assembleProdKernelRelease';
} else {
gradleBuildCommand = 'assembleProdMinSdkProdKernelRelease';
Expand All @@ -1050,19 +1052,26 @@ async function buildShellAppAsync(context: StandaloneContext, sdkVersion: string
},
});
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
await fs.copy(
path.join(
shellPath,
'app',
'build',
'outputs',
'apk',
'prodKernel',
'release',
'app-prodKernel-release.apk'
),
'shell.apk'
);
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
await fs.copy(
path.join(shellPath, 'app', 'build', 'outputs', 'apk', 'release', 'app-release.apk'),
'shell.apk'
);
} else {
await fs.copy(
path.join(
shellPath,
'app',
'build',
'outputs',
'apk',
'prodKernel',
'release',
'app-prodKernel-release.apk'
),
'shell.apk'
);
}
// -c means "only verify"
await spawnAsync(`zipalign`, ['-c', '-v', '4', 'shell.apk'], {
pipeToLogger: true,
Expand Down Expand Up @@ -1133,7 +1142,9 @@ async function buildShellAppAsync(context: StandaloneContext, sdkVersion: string
await fs.remove('shell-debug.apk');
} catch (e) {}
let gradleBuildCommand;
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
gradleBuildCommand = 'assembleDebug';
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
gradleBuildCommand = 'assembleDevKernelDebug';
} else {
gradleBuildCommand = 'assembleDevMinSdkDevKernelDebug';
Expand All @@ -1144,7 +1155,9 @@ async function buildShellAppAsync(context: StandaloneContext, sdkVersion: string
cwd: shellPath,
});
let apkPath;
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
apkPath = path.join(shellPath, 'app', 'build', 'outputs', 'apk', 'debug', 'app-debug.apk');
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
apkPath = path.join(
shellPath,
'app',
Expand Down

0 comments on commit 3ca73ce

Please sign in to comment.