diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle index 784354c2..07d4dfa6 100644 --- a/bin/templates/project/build.gradle +++ b/bin/templates/project/build.gradle @@ -74,6 +74,10 @@ ext { if (!project.hasProperty('cdvBuildMultipleApks')) { cdvBuildMultipleApks = null } + // Whether to append a 0 "abi digit" to versionCode when only a single APK is build + if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) { + cdvVersionCodeForceAbiDigit = null + } // .properties files to use for release signing. if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) { cdvReleaseSigningPropertiesFile = null @@ -115,6 +119,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('release-signing.propert // Cast to appropriate types. ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); +ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean(); ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : Integer.parseInt('' + cdvMinSdkVersion) ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) @@ -142,6 +147,7 @@ task cdvPrintProps << { println('cdvCompileSdkVersion=' + cdvCompileSdkVersion) println('cdvBuildToolsVersion=' + cdvBuildToolsVersion) println('cdvVersionCode=' + cdvVersionCode) + println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit) println('cdvMinSdkVersion=' + cdvMinSdkVersion) println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) @@ -218,6 +224,11 @@ android { } } } + } else if (Boolean.valueOf(cdvVersionCodeForceAbiDigit)) { + // This provides compatibility to the default logic for versionCode before cordova-android 5.2.0 + defaultConfig { + versionCode defaultConfig.versionCode*10 + } } /*