Merge pull request #2284 from vector-im/feature/bma/versionCode
Feature/bma/version code
This commit is contained in:
commit
83925322cb
@ -65,9 +65,8 @@ allprojects {
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
// Warnings are potential errors, so stop ignoring them
|
||||
// You can override by passing `-PallWarningsAsErrors=false` in the command line
|
||||
kotlinOptions.allWarningsAsErrors = project.properties['allWarningsAsErrors']?.toBoolean() ?: true
|
||||
kotlinOptions.allWarningsAsErrors = project.getProperties().getOrDefault("allWarningsAsErrors", "true").toBoolean()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
@ -39,9 +39,9 @@ def generateVersionCodeFromVersionName() {
|
||||
|
||||
def getVersionCode() {
|
||||
if (gitBranchName() == "develop") {
|
||||
return generateVersionCodeFromTimestamp() * 10
|
||||
return generateVersionCodeFromTimestamp()
|
||||
} else {
|
||||
return generateVersionCodeFromVersionName() * 10
|
||||
return generateVersionCodeFromVersionName()
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,13 +166,14 @@ android {
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
// assign different version code for each output
|
||||
def baseVariantVersion = variant.versionCode * 10
|
||||
variant.outputs.each { output ->
|
||||
def baseAbiVersionCode = project.ext.abiVersionCodes.get(output.getFilter(OutputFile.ABI))
|
||||
// Known limitation: it does not modify the value in the BuildConfig.java generated file
|
||||
print "ABI " + output.getFilter(OutputFile.ABI) + " \tvariant.versionCode " + variant.versionCode
|
||||
// See https://issuetracker.google.com/issues/171133218
|
||||
output.versionCodeOverride = variant.versionCode + baseAbiVersionCode
|
||||
print " \t-> VersionCode = " + output.versionCodeOverride + "\n"
|
||||
output.versionCodeOverride = baseVariantVersion + baseAbiVersionCode
|
||||
print "ABI " + output.getFilter(OutputFile.ABI) + " \t-> VersionCode = " + output.versionCodeOverride + "\n"
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user