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()
|
.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 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 {
|
android {
|
||||||
namespace = "com.rosetta.messenger"
|
namespace = "com.rosetta.messenger"
|
||||||
@@ -34,8 +34,8 @@ android {
|
|||||||
applicationId = "com.rosetta.messenger"
|
applicationId = "com.rosetta.messenger"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = computedVersionCode
|
versionCode = rosettaVersionCode
|
||||||
versionName = computedVersionName
|
versionName = rosettaVersionName
|
||||||
buildConfigField("String", "GIT_SHA", "\"$gitShortSha\"")
|
buildConfigField("String", "GIT_SHA", "\"$gitShortSha\"")
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.airbnb.lottie.compose.*
|
import com.airbnb.lottie.compose.*
|
||||||
import com.rosetta.messenger.R
|
import com.rosetta.messenger.R
|
||||||
|
import com.rosetta.messenger.BuildConfig
|
||||||
import com.rosetta.messenger.data.AccountManager
|
import com.rosetta.messenger.data.AccountManager
|
||||||
import com.rosetta.messenger.data.EncryptedAccount
|
import com.rosetta.messenger.data.EncryptedAccount
|
||||||
import com.rosetta.messenger.data.RecentSearchesManager
|
import com.rosetta.messenger.data.RecentSearchesManager
|
||||||
@@ -904,7 +905,7 @@ fun ChatsListScreen(
|
|||||||
Alignment.CenterStart
|
Alignment.CenterStart
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "Rosetta v1.0.0",
|
text = "Rosetta v${BuildConfig.VERSION_NAME}",
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color =
|
color =
|
||||||
if (isDarkTheme)
|
if (isDarkTheme)
|
||||||
|
|||||||
Reference in New Issue
Block a user