@@ -16,14 +16,6 @@ buildscript {
16
16
}
17
17
}
18
18
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
-
27
19
def safeExtGet (prop , fallback ) {
28
20
rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
29
21
}
@@ -57,9 +49,7 @@ def resolveReactNativeDirectory() {
57
49
)
58
50
}
59
51
60
- if (isNewArchitectureEnabled()) {
61
- apply plugin : ' com.facebook.react'
62
- }
52
+ apply plugin : ' com.facebook.react'
63
53
64
54
apply plugin : ' com.android.library'
65
55
apply plugin : ' kotlin-android'
@@ -147,27 +137,28 @@ android {
147
137
defaultConfig {
148
138
minSdkVersion safeExtGet(' minSdkVersion' , 24 )
149
139
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
+
151
144
buildConfigField " int" , " REACT_NATIVE_MINOR_VERSION" , REACT_NATIVE_MINOR_VERSION . toString()
152
145
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"
171
162
}
172
163
}
173
164
}
@@ -177,11 +168,9 @@ android {
177
168
targetCompatibility JavaVersion . VERSION_1_8
178
169
}
179
170
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"
185
174
}
186
175
}
187
176
@@ -210,13 +199,8 @@ android {
210
199
srcDirs + = ' nosvg/src/main/java'
211
200
}
212
201
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'
220
204
}
221
205
}
222
206
0 commit comments