@zkty-team/x-engine-module-template
v0.0.34
Published
gradle read version from config file https://stackoverflow.com/questions/47492210/react-native-automatic-version-name-from-package-json-to-android-build-manifes ``` groovy // On top of your file import a JSON parser import groovy.json.JsonSlurper
Downloads
2
Readme
gradle read version from config file https://stackoverflow.com/questions/47492210/react-native-automatic-version-name-from-package-json-to-android-build-manifes
// On top of your file import a JSON parser
import groovy.json.JsonSlurper
// Create an easy to use function
def getVersionFromNpm() {
// Read and parse package.json file from project root
def inputFile = new File("$rootDir/../package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)
// Return the version, you can get any value this way
return packageJson["version"]
}
android {
defaultConfig {
applicationId "your.app.id"
versionName getVersionFromNpm()
}
}
pod config file https://stackoverflow.com/questions/21405457/autoincrement-versioncode-with-gradle-extra-properties