feat(build): add separate versionCode for debug build type

Renamed purefinVersionCode to purefinReleaseVersionCode and added purefinDebugVersionCode to allow independent version tracking for debug and release builds.
This commit is contained in:
2026-05-23 09:31:47 +00:00
parent 2e4eb2fb30
commit 8d73974add
3 changed files with 6 additions and 4 deletions

View File

@@ -86,11 +86,11 @@ Upload via the API at `POST /api/apps/{app_name}/upload`:
```bash
curl -X POST "https://apks.t.bbara.hu/api/apps/purefin-app-debug/upload" \
-F "apk_file=@app/build/outputs/apk/debug/app-debug.apk" \
-F "version_code=$(grep purefinVersionCode gradle.properties | cut -d= -f2)" \
-F "version_code=$(grep purefinDebugVersionCode gradle.properties | cut -d= -f2)" \
-F "version_name=0.1-debug"
```
The `version_code` is defined in `gradle.properties` (`purefinVersionCode` for phone, `purefinTvVersionCode` for TV). The `version_name` is `0.1` for release or `0.1-debug` for debug. Both fields are required — the server cannot auto-extract them from the APK.
The `version_code` is defined in `gradle.properties` (`purefinReleaseVersionCode` for phone release, `purefinDebugVersionCode` for phone debug, `purefinTvVersionCode` for TV). The `version_name` is `0.1` for release or `0.1-debug` for debug. Both fields are required — the server cannot auto-extract them from the APK.
## Usage

View File

@@ -17,7 +17,6 @@ android {
applicationId = "hu.bbara.purefin"
minSdk = 29
targetSdk = 36
versionCode = providers.gradleProperty("purefinVersionCode").get().toInt()
versionName = "0.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
@@ -25,10 +24,12 @@ android {
buildTypes {
debug {
applicationIdSuffix = ".debug"
versionCode = providers.gradleProperty("purefinDebugVersionCode").get().toInt()
versionNameSuffix = "-debug"
manifestPlaceholders["updateManifestUrl"] = "https://apks.t.bbara.hu/apks/purefin-app-debug/update.json"
}
release {
versionCode = providers.gradleProperty("purefinReleaseVersionCode").get().toInt()
// Enables code-related app optimization.
isMinifyEnabled = true

View File

@@ -28,5 +28,6 @@ android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=false
android.builtInKotlin=false
android.newDsl=false
purefinVersionCode=1000018
purefinReleaseVersionCode=1000018
purefinDebugVersionCode=1000000
purefinTvVersionCode=2000009