[Android] Make sure we use the react-native version in node_modules

Releases are also published to jcenter, and due to how the dependency is
declared, we are picking the latest release from there, which is arguably not
what we want.
This commit is contained in:
Saúl Ibarra Corretgé 2018-05-15 12:56:42 +02:00 committed by Paweł Domas
parent 362486cbea
commit 52da5010cc
1 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,21 @@ allprojects {
maven { url "$rootDir/../node_modules/react-native/android" }
}
// Make sure we use the react-native version in node_modules and not the one
// published in jcenter / elsewhere.
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react'
&& details.requested.name == 'react-native') {
def file = new File("$rootDir/../node_modules/react-native/package.json")
def version = new groovy.json.JsonSlurper().parseText(file.text).version
details.useVersion version
}
}
}
}
// Third-party react-native modules which Jitsi Meet SDK for Android depends
// on and which are not available in third-party Maven repositories need to
// be deployed in a Maven repository of ours.