Skip to content

Commit a5ee49b

Browse files
committed
android build: Add reactNativeArchitectures Gradle property
This corresponds to two changes in the RN template app, leading up to RN v0.68: facebook/react-native@43c38cdc8 Allow specifying an architecture in RNTester and release builds facebook/react-native@0f39a1076 Make the `reactNativeArchitectures` property more discoverable Nothing will break without this, but it seems like potentially a convenient feature sometimes -- speed up an iteration cycle by limiting the build to just one architecture. And including it helps keep down the diff from the template app, slightly simplifying future RN upgrades.
1 parent 8119936 commit a5ee49b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

android/app/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ def jscFlavor = 'org.webkit:android-jsc-intl:+'
130130
*/
131131
def enableHermes = project.ext.react.get("enableHermes", false);
132132

133+
/**
134+
* Architectures to build native code for.
135+
*/
136+
def reactNativeArchitectures() {
137+
def value = project.getProperties().get("reactNativeArchitectures")
138+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
139+
}
140+
133141
android {
134142
defaultConfig {
135143
applicationId "com.zulipmobile"
@@ -164,7 +172,7 @@ android {
164172
reset()
165173
enable true // Build a separate APK for each ABI.
166174
universalApk false // If true, also generate a universal APK
167-
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
175+
include (*reactNativeArchitectures())
168176
}
169177
}
170178
buildTypes {

android/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ android.enableJetifier=true
2929

3030
# Version of flipper SDK to use with React Native
3131
FLIPPER_VERSION=0.99.0
32+
33+
# Use this property to specify which architecture you want to build.
34+
# You can also override it from the CLI using
35+
# tools/gradle <task> -PreactNativeArchitectures=x86_64
36+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

0 commit comments

Comments
 (0)