mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
Update github pre-release versionName
This commit is contained in:
parent
bf38f35539
commit
f3a778db5c
@ -2,6 +2,15 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: "androidx.navigation.safeargs"
|
apply plugin: "androidx.navigation.safeargs"
|
||||||
apply from: 'sentry.gradle'
|
apply from: 'sentry.gradle'
|
||||||
|
|
||||||
|
def getGitHash = { ->
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return stdout.toString().trim()
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
|
|
||||||
@ -55,7 +64,7 @@ android {
|
|||||||
productFlavors {
|
productFlavors {
|
||||||
github {
|
github {
|
||||||
dimension "repo"
|
dimension "repo"
|
||||||
versionNameSuffix "-github"
|
// versionNameSuffix "-github" // appended in assemble task
|
||||||
buildConfigField("String", "dsn", SENTRY_DSN)
|
buildConfigField("String", "dsn", SENTRY_DSN)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,9 +80,16 @@ android {
|
|||||||
def builtType = variant.buildType.name
|
def builtType = variant.buildType.name
|
||||||
def versionName = variant.versionName
|
def versionName = variant.versionName
|
||||||
// def versionCode = variant.versionCode
|
// def versionCode = variant.versionCode
|
||||||
// def flavor = variant.flavorName
|
def flavor = variant.flavorName
|
||||||
// flavor is already appended to versionName due to versionNameSuffix
|
|
||||||
outputFileName = "barinsta_${versionName}_${builtType}.apk"
|
def suffix = "${versionName}-${flavor}_${builtType}" // eg. 19.1.0-github_debug or release
|
||||||
|
if (builtType.toString() == 'release' && project.hasProperty("pre")) {
|
||||||
|
// append latest commit short hash for pre-release
|
||||||
|
suffix = "${versionName}.${getGitHash()}-${flavor}" // eg. 19.1.0.b123456-github
|
||||||
|
}
|
||||||
|
|
||||||
|
output.versionNameOverride = suffix
|
||||||
|
outputFileName = "barinsta_${suffix}.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user