replace Integer.parseInt with BigInteger so that you can use longer Android version codes

I used to have DNS like version codes (YYYYmmmddXX format) for my apps builds, and I can't go back in older apps because Google Play wont allow me to upload inferior version codes, so I thing we should to use BigInteger instead of Integer.parseInt

This closes #298
This commit is contained in:
Pierre-Alexis de Solminihac 2016-04-22 19:10:49 +02:00 committed by Joe Bowser
parent d2a159d2dc
commit 23fd0982b0
2 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ android {
} }
defaultConfig { defaultConfig {
versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode")) versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package") applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) { if (cdvMinSdkVersion != null) {

View File

@ -125,7 +125,7 @@ def doExtractIntFromManifest(name) {
def pattern = Pattern.compile(name + "=\"(\\d+)\"") def pattern = Pattern.compile(name + "=\"(\\d+)\"")
def matcher = pattern.matcher(manifestFile.getText()) def matcher = pattern.matcher(manifestFile.getText())
matcher.find() matcher.find()
return Integer.parseInt(matcher.group(1)) return new BigInteger(matcher.group(1))
} }
def doExtractStringFromManifest(name) { def doExtractStringFromManifest(name) {