32 行
915 B
Groovy
32 行
915 B
Groovy
import groovy.json.JsonSlurper
|
|
|
|
plugins {
|
|
id "com.android.library" version "9.1.0" apply false
|
|
}
|
|
|
|
def reactNativePackage = file("../node_modules/react-native/package.json")
|
|
if (!reactNativePackage.isFile()) {
|
|
throw new GradleException("Run pnpm install before compiling the RN Android bridge")
|
|
}
|
|
|
|
def reactNativeVersion = new JsonSlurper().parse(reactNativePackage).version
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven { url "https://nexus.xuqinmin.com/repository/android/" }
|
|
}
|
|
|
|
configurations.configureEach {
|
|
resolutionStrategy.eachDependency { details ->
|
|
if (details.requested.group == "com.facebook.react" &&
|
|
details.requested.name == "react-android" &&
|
|
!details.requested.version) {
|
|
details.useVersion(reactNativeVersion)
|
|
details.because("The host React Native Gradle plugin normally supplies this version")
|
|
}
|
|
}
|
|
}
|
|
}
|