Skip to content

Commit 60c3c79

Browse files
authored
Merge pull request #42 from Shopify/update-release-signing-config
update release signing config and add release build script
2 parents 17fb077 + 6fcd6ca commit 60c3c79

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ modules/react-native-shopify-checkout-kit/android/gradle/wrapper/gradle-wrapper.
8888
modules/react-native-shopify-checkout-kit/android/gradle/wrapper/gradle-wrapper.properties
8989
modules/react-native-shopify-checkout-kit/android/gradlew
9090
modules/react-native-shopify-checkout-kit/android/gradlew.bat
91+
92+
# Sample bundle
93+
**/index.android.bundle

sample/android/app/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ android {
8989
applicationId "com.shopify.checkoutkitreactnative"
9090
minSdkVersion rootProject.ext.minSdkVersion
9191
targetSdkVersion rootProject.ext.targetSdkVersion
92-
versionCode 1
92+
versionCode 5
9393
versionName "1.0"
9494
}
9595
signingConfigs {
@@ -99,15 +99,21 @@ android {
9999
keyAlias 'androiddebugkey'
100100
keyPassword 'android'
101101
}
102+
release {
103+
if (project.hasProperty('CHECKOUT_KIT_UPLOAD_STORE_FILE')) {
104+
storeFile file(CHECKOUT_KIT_UPLOAD_STORE_FILE)
105+
storePassword CHECKOUT_KIT_UPLOAD_STORE_PASSWORD
106+
keyAlias CHECKOUT_KIT_UPLOAD_STORE_ALIAS
107+
keyPassword CHECKOUT_KIT_UPLOAD_KEY_PASSWORD
108+
}
109+
}
102110
}
103111
buildTypes {
104112
debug {
105113
signingConfig signingConfigs.debug
106114
}
107115
release {
108-
// Caution! In production, you need to generate your own keystore file.
109-
// see https://reactnative.dev/docs/signed-apk-android.
110-
signingConfig signingConfigs.debug
116+
signingConfig signingConfigs.release
111117
minifyEnabled enableProguardInReleaseBuilds
112118
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
113119
}

sample/scripts/release_android

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
cd sample
6+
7+
mkdir -p android/app/src/main/assets
8+
npx react-native bundle --platform android \
9+
--dev false \
10+
--entry-file index.js \
11+
--bundle-output android/app/src/main/assets/index.android.bundle \
12+
13+
npx react-native build-android --mode=release
14+
15+
echo "Run \"cd sample && npx react-native run-android --variant=release\" to test the release build"
16+
echo "Output bundle location: sample/android/app/build/outputs/bundle/release/app-release.aab"

0 commit comments

Comments
 (0)