Skip to content

Commit b2eb2a4

Browse files
committed
fix: build.gradle.kts not falling back to default ABIs (#9611)
## Summary When migrating to Kotlin DSL for `build.gradle` files we introduced a regression where an empty string for React Native Architectures would no longer be considered `falsy` and wouldn't fallback to the default ABI list. ## Test plan Try passing an empty string as ABIs and see that now that correctly fall backs to the default list. (cherry picked from commit d14c90f)
1 parent 1fb7b3a commit b2eb2a4

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

packages/react-native-reanimated/android/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ val reanimatedPrefabHeadersDir: File = project.file("${layout.buildDirectory.get
121121

122122
fun reactNativeArchitectures(): List<String> {
123123
val value = project.findProperty("reactNativeArchitectures") as String?
124-
return value?.split(",") ?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
124+
return value?.split(",")
125+
?.map { it.trim() }
126+
?.filter { it.isNotEmpty() }
127+
?.ifEmpty { null }
128+
?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
125129
}
126130

127131
if (project == rootProject) {

packages/react-native-worklets/android/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ val workletsPrefabHeadersDir: File = project.file("${layout.buildDirectory.get()
136136

137137
fun reactNativeArchitectures(): List<String> {
138138
val value = project.findProperty("reactNativeArchitectures") as String?
139-
return value?.split(",") ?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
139+
return value?.split(",")
140+
?.map { it.trim() }
141+
?.filter { it.isNotEmpty() }
142+
?.ifEmpty { null }
143+
?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
140144
}
141145

142146
if (project == rootProject) {

packages/react-native-worklets/android/fix-prefab.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
fun reactNativeArchitectures(): List<String> {
22
val value = project.findProperty("reactNativeArchitectures") as String?
3-
return value?.split(",") ?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
3+
return value?.split(",")
4+
?.map { it.trim() }
5+
?.filter { it.isNotEmpty() }
6+
?.ifEmpty { null }
7+
?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
48
}
59

610
tasks.configureEach {

0 commit comments

Comments
 (0)