mirror of
https://github.com/RoboSats/robosats.git
synced 2025-08-14 21:37:14 +00:00
Merge pull request #2156 from RoboSats/update-android-architecture-versioning-strategy
Update android architecture versioning strategy
This commit is contained in:
4
.github/workflows/android-build.yml
vendored
4
.github/workflows/android-build.yml
vendored
@ -17,10 +17,10 @@ on:
|
||||
required: true
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths: [ "mobile", "frontend" ]
|
||||
paths: [ "android", "frontend" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths: [ "mobile", "frontend" ]
|
||||
paths: [ "android", "frontend" ]
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
|
@ -1,5 +1,7 @@
|
||||
import com.android.build.api.dsl.Packaging
|
||||
|
||||
val baseVersionCode = 81
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
@ -13,7 +15,7 @@ android {
|
||||
applicationId = "com.robosats"
|
||||
minSdk = 26
|
||||
targetSdk = 36
|
||||
versionCode = 15
|
||||
versionCode = baseVersionCode
|
||||
versionName = "0.8.1-alpha"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
@ -65,6 +67,24 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
// Configure unique version codes for ABI splits to prevent downgrade issues
|
||||
androidComponents {
|
||||
onVariants { variant ->
|
||||
val abiCodes = mapOf(
|
||||
"armeabi-v7a" to 1,
|
||||
"arm64-v8a" to 2,
|
||||
"x86" to 3,
|
||||
"x86_64" to 4
|
||||
)
|
||||
|
||||
variant.outputs.forEach { output ->
|
||||
val abiName = output.filters.find { it.filterType.name == "ABI" }?.identifier
|
||||
val abiVersionCode = abiCodes[abiName] ?: 0 // Universal APK gets 0
|
||||
output.versionCode.set(baseVersionCode * 1000 + abiVersionCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.appcompat)
|
||||
|
Reference in New Issue
Block a user