Created
November 27, 2018 12:23
-
-
Save hypest/742448b9588b3a0aa580a5e80ae95bdf to your computer and use it in GitHub Desktop.
Gradle util to extract react-native version from package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper | |
def readReactNativeVersion(packagejson, section) { | |
def packageSlurper = new JsonSlurper() | |
def packageJson = packageSlurper.parse file(packagejson) | |
return packageJson.get(section).get('react-native') | |
} | |
ext { | |
readReactNativeVersion = this.&readReactNativeVersion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment