Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVEMENT] Android APK Size, App Load Time, Bitrise Build Steps #3423

Merged
merged 14 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ import com.android.build.OutputFile

project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
enableHermes: System.getenv('METAMASK_ENVIRONMENT') == 'production'
]

apply from: "../../node_modules/react-native/react.gradle"
Expand All @@ -125,12 +125,7 @@ apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false

/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def enableSeparateBuildPerCPUArchitecture = true

/**
* The preferred build flavor of JavaScriptCore.
Expand Down Expand Up @@ -168,7 +163,6 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 790
versionName "3.6.0"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -189,7 +183,6 @@ android {
}

signingConfigs {
def pass = ""
release {
storeFile file('../keystores/release.keystore')
storePassword System.getenv("BITRISEIO_ANDROID_KEYSTORE_PASSWORD")
Expand All @@ -209,18 +202,20 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}

buildTypes {
debug {
manifestPlaceholders = [isDebug:true]
signingConfig signingConfigs.debug
multiDexEnabled true
}
release {
manifestPlaceholders = [isDebug:false]
minifyEnabled enableProguardInReleaseBuilds
minifyEnabled true
multiDexEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
Expand Down
31 changes: 30 additions & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ workflows:
title: All Tests Passed
is_always_run: false
# Parallel Build & Deploy Steps
start_release_builds:
start_bitrise_release_builds:
before_run:
- code_setup_cache
steps:
Expand All @@ -170,6 +170,23 @@ workflows:
- abort_on_fail: 'yes'
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
start_store_release_builds:
before_run:
- code_setup_cache
steps:
- build-router-start@0:
inputs:
- workflows: |-
android_store_release_step
ios_store_release_step
- wait_for_builds: 'true'
- abort_on_fail: 'yes'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- build-router-wait@0:
inputs:
- abort_on_fail: 'yes'
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $BITRISE_DEPLOY_DIR/app-release.apk
Expand Down Expand Up @@ -213,6 +230,10 @@ workflows:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/release/sha512sums.txt
title: Bitrise Deploy Checksum
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/mapping/release/mapping.txt
title: Bitrise ProGuard Map Files
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/release/app-release.aab
Expand All @@ -221,6 +242,10 @@ workflows:
inputs:
- deploy_path: sourcemaps/android/index.js.map
title: Bitrise Deploy Sourcemaps
android_store_release_step:
before_run:
- android_test_release_step
steps:
- google-play-deploy@3:
inputs:
- app_path: $PROJECT_LOCATION/app/build/outputs/bundle/release/app-release.aab
Expand Down Expand Up @@ -263,6 +288,10 @@ workflows:
inputs:
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
ios_store_release_step:
before_run:
- ios_test_release_step
steps:
- deploy-to-itunesconnect-application-loader@1:
inputs:
- ipa_path: ios/build/output/MetaMask.ipa
Expand Down