mirror of
https://github.com/RoboSats/robosats.git
synced 2025-08-15 06:17:20 +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
|
required: true
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths: [ "mobile", "frontend" ]
|
paths: [ "android", "frontend" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths: [ "mobile", "frontend" ]
|
paths: [ "android", "frontend" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-android:
|
build-android:
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import com.android.build.api.dsl.Packaging
|
import com.android.build.api.dsl.Packaging
|
||||||
|
|
||||||
|
val baseVersionCode = 81
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
@ -13,7 +15,7 @@ android {
|
|||||||
applicationId = "com.robosats"
|
applicationId = "com.robosats"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 15
|
versionCode = baseVersionCode
|
||||||
versionName = "0.8.1-alpha"
|
versionName = "0.8.1-alpha"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
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 {
|
dependencies {
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
implementation(libs.androidx.appcompat)
|
implementation(libs.androidx.appcompat)
|
||||||
|
Reference in New Issue
Block a user