android: fix warning

This commit is contained in:
Saúl Ibarra Corretgé 2018-12-19 13:05:24 +01:00 committed by Zoltan Bettenbuk
parent 85b141db89
commit d18f582922
1 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,5 @@
import groovy.json.JsonSlurper
// Top-level build file where you can add configuration options common to all
// sub-projects/modules.
@ -34,13 +36,13 @@ allprojects {
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
def version = new JsonSlurper().parseText(file.text).version
details.useVersion version
}
if (details.requested.group == 'org.webkit'
&& details.requested.name == 'android-jsc') {
def file = new File("$rootDir/../node_modules/jsc-android/package.json")
def version = new groovy.json.JsonSlurper().parseText(file.text).version
def version = new JsonSlurper().parseText(file.text).version
details.useVersion "r${version.tokenize('.')[0]}"
}
}
@ -65,7 +67,7 @@ allprojects {
afterEvaluate { project ->
if (project.name.startsWith('react-native-')) {
def npmManifest = project.file('../package.json')
def json = new groovy.json.JsonSlurper().parseText(npmManifest.text)
def json = new JsonSlurper().parseText(npmManifest.text)
// React Native modules have an npm peer dependency on react-native,
// they do not have an npm dependency on it. Further below though we