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

Commit

Permalink
[xdl] Assemble/bundle only the :app project (#1937)
Browse files Browse the repository at this point in the history
# Why

I have noticed that not only the `app` project is being built on Turtle, but all the projects.

# How

I've scoped the Gradle command to only build/assemble the `:app` project. It should be safe to do for all SDKs, since on all SDKs the app project was called `app`.

# Test plan

Published an alpha version of XDL to NPM, upgraded Turtle to it, deployed to staging and ran the build. It was over a minute faster than without this change ([new](https://staging.expo.io/dashboard/sjchmiela/builds/5c386cef-e808-49d3-91d8-9ce42af77c36) vs [old](https://staging.expo.io/dashboard/sjchmiela/builds/3d36340e-6ae1-4476-91cb-07d81f1edd1e)).
  • Loading branch information
sjchmiela authored Apr 21, 2020
1 parent 902e827 commit 13c0944
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/xdl/src/detach/AndroidShellApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,16 +1233,16 @@ async function buildShellAppAsync(context, sdkVersion, buildType, buildMode) {
let outputPath;
if (buildType === 'app-bundle') {
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 36) {
gradleBuildCommand = `bundle${debugOrRelease}`;
gradleBuildCommand = `:app:bundle${debugOrRelease}`;
outputPath = path.join(outputDirPath, debugOrReleaseL, `app-${debugOrReleaseL}.aab`);
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
gradleBuildCommand = `bundle${debugOrRelease}`;
gradleBuildCommand = `:app:bundle${debugOrRelease}`;
outputPath = path.join(outputDirPath, debugOrReleaseL, `app.aab`);
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
gradleBuildCommand = `bundle${devOrProd}Kernel${debugOrRelease}`;
gradleBuildCommand = `:app:bundle${devOrProd}Kernel${debugOrRelease}`;
outputPath = path.join(outputDirPath, `${devOrProdL}Kernel${debugOrRelease}`, `app.aab`);
} else {
// gradleBuildCommand = `bundle${devOrProd}MinSdk${devOrProd}Kernel${debugOrRelease}`;
// gradleBuildCommand = `:app:bundle${devOrProd}MinSdk${devOrProd}Kernel${debugOrRelease}`;
// outputPath = path.join(
// outputDirPath,
// `${devOrProdL}MinSdk${devOrProd}Kernel`,
Expand All @@ -1256,18 +1256,18 @@ async function buildShellAppAsync(context, sdkVersion, buildType, buildMode) {
}
} else {
if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 33) {
gradleBuildCommand = `assemble${debugOrRelease}`;
gradleBuildCommand = `:app:assemble${debugOrRelease}`;
outputPath = path.join(outputDirPath, debugOrReleaseL, `app-${debugOrReleaseL}.apk`);
} else if (ExponentTools.parseSdkMajorVersion(sdkVersion) >= 32) {
gradleBuildCommand = `assemble${devOrProd}Kernel${debugOrRelease}`;
gradleBuildCommand = `:app:assemble${devOrProd}Kernel${debugOrRelease}`;
outputPath = path.join(
outputDirPath,
`${devOrProdL}Kernel`,
debugOrReleaseL,
`app-${devOrProdL}Kernel-${debugOrReleaseL}.apk`
);
} else {
gradleBuildCommand = `assemble${devOrProd}MinSdk${devOrProd}Kernel${debugOrRelease}`;
gradleBuildCommand = `:app:assemble${devOrProd}MinSdk${devOrProd}Kernel${debugOrRelease}`;
outputPath = path.join(
outputDirPath,
`${devOrProdL}MinSdk${devOrProd}Kernel`,
Expand Down

0 comments on commit 13c0944

Please sign in to comment.