diff --git a/android/build.gradle b/android/build.gradle index 45d5af7a1..a5f5fd326 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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