-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathlinking.gradle
46 lines (38 loc) · 1.43 KB
/
linking.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def isExpoLinked = false
rootProject.getSubprojects().forEach({ project ->
if (project.plugins.hasPlugin("com.android.application")) {
if (project.configurations.implementation.getDependencies().find { dep -> dep.name == "expo" }) {
isExpoLinked = true
}
}
})
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
if (isExpoLinked) {
apply plugin: 'com.android.library'
android {
// Disable aar bundling to fix the error when running `gradle assembleRelease` over `gradle :app:assembleRelease`
// which will throw `Direct local .aar file dependencies are not supported when building an AAR.`
tasks.whenTaskAdded { task ->
if (['bundleDebugAar', 'bundleReleaseAar'].contains(task.name)) {
task.enabled = false
}
}
compileSdkVersion safeExtGet('compileSdkVersion', 30)
sourceSets {
main.manifest.srcFile 'src/AndroidManifest.xml'
main.java.srcDirs = [ 'expo/src/main/java' ]
}
libraryVariants.all {
generateBuildConfigProvider?.get()?.enabled = false
}
}
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation project(':expo-modules-core')
project.configurations.default.artifacts.each { artifact ->
api files(artifact.file)
}
}
}