Add version.properties and read version in build.gradle

Single source of truth: bump VERSION_NAME/VERSION_CODE in version.properties
to release a new version. BuildConfig.VERSION_NAME exposed to the app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 20:27:43 +00:00
parent cff4233de6
commit 74316f17d6
3 changed files with 11 additions and 3 deletions
+8 -2
View File
@@ -1,3 +1,5 @@
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
@@ -7,6 +9,10 @@ plugins {
alias(libs.plugins.ksp)
}
val versionProps = Properties().apply {
load(rootProject.file("version.properties").inputStream())
}
android {
namespace = "com.syncflow"
compileSdk = 34
@@ -15,8 +21,8 @@ android {
applicationId = "com.syncflow"
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "1.0.0"
versionCode = versionProps["VERSION_CODE"].toString().toInt()
versionName = versionProps["VERSION_NAME"].toString()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Placeholder — replace with real keys before release