Skip to content

Commit 2efa4d5

Browse files
committed
drop support in android build
1 parent ff64e3f commit 2efa4d5

File tree

1 file changed

+26
-42
lines changed

1 file changed

+26
-42
lines changed

packages/react-native-gesture-handler/android/build.gradle

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ buildscript {
1616
}
1717
}
1818

19-
def isNewArchitectureEnabled() {
20-
// To opt-in for the New Architecture, you can either:
21-
// - Set `newArchEnabled` to true inside the `gradle.properties` file
22-
// - Invoke gradle with `-newArchEnabled=true`
23-
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
24-
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
25-
}
26-
2719
def safeExtGet(prop, fallback) {
2820
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2921
}
@@ -57,9 +49,7 @@ def resolveReactNativeDirectory() {
5749
)
5850
}
5951

60-
if (isNewArchitectureEnabled()) {
61-
apply plugin: 'com.facebook.react'
62-
}
52+
apply plugin: 'com.facebook.react'
6353

6454
apply plugin: 'com.android.library'
6555
apply plugin: 'kotlin-android'
@@ -147,27 +137,28 @@ android {
147137
defaultConfig {
148138
minSdkVersion safeExtGet('minSdkVersion', 24)
149139
targetSdkVersion safeExtGet('targetSdkVersion', 33)
150-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
140+
141+
// TODO: Determine if IS_NEW_ARCHITECTURE_ENABLED has to be set
142+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
143+
151144
buildConfigField "int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()
152145

153-
if (isNewArchitectureEnabled()) {
154-
var appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
155-
externalNativeBuild {
156-
cmake {
157-
cppFlags "-O2", "-frtti", "-fexceptions", "-Wall", "-Werror", "-std=c++20", "-DANDROID"
158-
arguments "-DREACT_NATIVE_DIR=${REACT_NATIVE_DIR}",
159-
"-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}",
160-
"-DANDROID_STL=c++_shared",
161-
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
162-
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
163-
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
164-
// for more information
165-
"-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--build-id=none"
166-
abiFilters(*reactNativeArchitectures())
167-
}
168-
ndkBuild {
169-
arguments "APP_LDFLAGS+=-Wl,--build-id=none"
170-
}
146+
var appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
147+
externalNativeBuild {
148+
cmake {
149+
cppFlags "-O2", "-frtti", "-fexceptions", "-Wall", "-Werror", "-std=c++20", "-DANDROID"
150+
arguments "-DREACT_NATIVE_DIR=${REACT_NATIVE_DIR}",
151+
"-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}",
152+
"-DANDROID_STL=c++_shared",
153+
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
154+
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
155+
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
156+
// for more information
157+
"-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--build-id=none"
158+
abiFilters(*reactNativeArchitectures())
159+
}
160+
ndkBuild {
161+
arguments "APP_LDFLAGS+=-Wl,--build-id=none"
171162
}
172163
}
173164
}
@@ -177,11 +168,9 @@ android {
177168
targetCompatibility JavaVersion.VERSION_1_8
178169
}
179170

180-
if (isNewArchitectureEnabled()) {
181-
externalNativeBuild {
182-
cmake {
183-
path "src/main/jni/CMakeLists.txt"
184-
}
171+
externalNativeBuild {
172+
cmake {
173+
path "src/main/jni/CMakeLists.txt"
185174
}
186175
}
187176

@@ -210,13 +199,8 @@ android {
210199
srcDirs += 'nosvg/src/main/java'
211200
}
212201

213-
if (isNewArchitectureEnabled()) {
214-
srcDirs += 'fabric/src/main/java'
215-
} else {
216-
// 'paper/src/main/java' includes files from codegen so the library can compile with
217-
// codegen turned off
218-
srcDirs += 'paper/src/main/java'
219-
}
202+
// TODO: flatteb fabric/src/main/java src dir into core
203+
srcDirs += 'fabric/src/main/java'
220204
}
221205
}
222206

0 commit comments

Comments
 (0)