1
1
apply plugin : " com.android.application"
2
2
3
3
import com.android.build.OutputFile
4
- import org.apache.tools.ant.taskdefs.condition.Os
5
4
6
5
/**
7
6
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -152,17 +151,13 @@ android {
152
151
" GENERATED_SRC_DIR=$buildDir /generated/source" ,
153
152
" PROJECT_BUILD_DIR=$buildDir " ,
154
153
" REACT_ANDROID_DIR=$rootDir /../node_modules/react-native/ReactAndroid" ,
155
- " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build"
154
+ " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build" ,
155
+ " NODE_MODULES_DIR=$rootDir /../node_modules"
156
156
cFlags " -Wall" , " -Werror" , " -fexceptions" , " -frtti" , " -DWITH_INSPECTOR=1"
157
157
cppFlags " -std=c++17"
158
158
// Make sure this target name is the same you specify inside the
159
159
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160
160
targets " helloworld_appmodules"
161
-
162
- // Fix for windows limit on number of character in file paths and in command lines
163
- if (Os . isFamily(Os . FAMILY_WINDOWS )) {
164
- arguments " NDK_APP_SHORT_COMMANDS=true"
165
- }
166
161
}
167
162
}
168
163
if (! enableSeparateBuildPerCPUArchitecture) {
@@ -282,9 +277,10 @@ dependencies {
282
277
}
283
278
284
279
if (enableHermes) {
285
- def hermesPath = " ../../node_modules/hermes-engine/android/" ;
286
- debugImplementation files(hermesPath + " hermes-debug.aar" )
287
- releaseImplementation files(hermesPath + " hermes-release.aar" )
280
+ // noinspection GradleDynamicVersion
281
+ implementation(" com.facebook.react:hermes-engine:+" ) { // From node_modules
282
+ exclude group :' com.facebook.fbjni'
283
+ }
288
284
} else {
289
285
implementation jscFlavor
290
286
}
@@ -297,7 +293,11 @@ if (isNewArchitectureEnabled()) {
297
293
configurations. all {
298
294
resolutionStrategy. dependencySubstitution {
299
295
substitute(module(" com.facebook.react:react-native" ))
300
- .using(project(" :ReactAndroid" )). because(" On New Architecture we're building React Native from source" )
296
+ .using(project(" :ReactAndroid" ))
297
+ .because(" On New Architecture we're building React Native from source" )
298
+ substitute(module(" com.facebook.react:hermes-engine" ))
299
+ .using(project(" :ReactAndroid:hermes-engine" ))
300
+ .because(" On New Architecture we're building Hermes from source" )
301
301
}
302
302
}
303
303
}
0 commit comments