feat: update versioning in build.gradle.kts and display dynamic version in ChatsListScreen
This commit is contained in:
@@ -18,13 +18,13 @@ fun safeGitOutput(vararg args: String): String? {
|
||||
.getOrNull()
|
||||
}
|
||||
|
||||
val versionBase = providers.gradleProperty("ROSETTA_VERSION_BASE").orElse("1.0")
|
||||
val explicitVersionCode = providers.gradleProperty("ROSETTA_VERSION_CODE").orNull?.toIntOrNull()
|
||||
val explicitVersionName = providers.gradleProperty("ROSETTA_VERSION_NAME").orNull
|
||||
val gitCommitCount = safeGitOutput("rev-list", "--count", "HEAD")?.toIntOrNull()
|
||||
val gitShortSha = safeGitOutput("rev-parse", "--short", "HEAD") ?: "unknown"
|
||||
val computedVersionCode = (explicitVersionCode ?: gitCommitCount ?: 1).coerceAtLeast(1)
|
||||
val computedVersionName = explicitVersionName ?: "${versionBase.get()}.$computedVersionCode"
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Rosetta versioning — bump here on each release
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
val rosettaVersionName = "1.0.1"
|
||||
val rosettaVersionCode = 2 // Increment on each release
|
||||
|
||||
android {
|
||||
namespace = "com.rosetta.messenger"
|
||||
@@ -34,8 +34,8 @@ android {
|
||||
applicationId = "com.rosetta.messenger"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = computedVersionCode
|
||||
versionName = computedVersionName
|
||||
versionCode = rosettaVersionCode
|
||||
versionName = rosettaVersionName
|
||||
buildConfigField("String", "GIT_SHA", "\"$gitShortSha\"")
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
Reference in New Issue
Block a user