feat: update versioning in build.gradle.kts and display dynamic version in ChatsListScreen

This commit is contained in:
2026-02-14 01:34:18 +05:00
parent 645d8913ac
commit 2df37611e2
2 changed files with 10 additions and 9 deletions

View File

@@ -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"