-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathapp-settings.gradle
More file actions
22 lines (19 loc) · 1.13 KB
/
app-settings.gradle
File metadata and controls
22 lines (19 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import org.gradle.initialization.DefaultSettings
ext.applyNodeAPISettings = { DefaultSettings settings ->
def searchDirectory = rootDir.toPath()
do {
def p = searchDirectory.resolve("node_modules/react-native")
if (p.toFile().exists()) {
println "[Node-API] !!! PATCHING HERMES WITH NODE-API SUPPORT !!! Found React Native in ${p.toRealPath().toString()}"
includeBuild(p.toRealPath().toString()) {
dependencySubstitution {
substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
}
}
break
}
} while (searchDirectory = searchDirectory.getParent())
}