kopia lustrzana https://github.com/ryukoposting/Signal-Android
Use current tag for nightly versionName.
rodzic
3f53abedab
commit
a4d458f969
|
@ -264,7 +264,7 @@ android {
|
||||||
|
|
||||||
nightly {
|
nightly {
|
||||||
dimension 'distribution'
|
dimension 'distribution'
|
||||||
versionNameSuffix "-nightly-${getDateSuffix()}"
|
versionNameSuffix "-nightly-untagged-${getDateSuffix()}"
|
||||||
ext.websiteUpdateUrl = "null"
|
ext.websiteUpdateUrl = "null"
|
||||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
||||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
||||||
|
@ -319,6 +319,10 @@ android {
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
if (output.baseName.contains('nightly')) {
|
if (output.baseName.contains('nightly')) {
|
||||||
output.versionCodeOverride = canonicalVersionCode * postFixSize + 5
|
output.versionCodeOverride = canonicalVersionCode * postFixSize + 5
|
||||||
|
def tag = getCurrentGitTag()
|
||||||
|
if (tag != null && tag.length() > 0) {
|
||||||
|
output.versionNameOverride = tag
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
||||||
def abiName = output.getFilter("ABI") ?: 'universal'
|
def abiName = output.getFilter("ABI") ?: 'universal'
|
||||||
|
@ -604,6 +608,26 @@ def getGitHash() {
|
||||||
return stdout.toString().trim()
|
return stdout.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCurrentGitTag() {
|
||||||
|
if (!(new File('.git').exists())) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'tag', '--points-at', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
|
||||||
|
def output = stdout.toString().trim()
|
||||||
|
|
||||||
|
if (output != null && output.size() > 0) {
|
||||||
|
return output.split('\n')[0];
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test) {
|
||||||
testLogging {
|
testLogging {
|
||||||
events "failed"
|
events "failed"
|
||||||
|
|
Ładowanie…
Reference in New Issue