Skip to content

Commit

Permalink
chore(fdroid): different version codes for different abis
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Aug 31, 2024
1 parent 492b524 commit 85cd1e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.android.build.api.variant.FilterConfiguration
import io.gitlab.arturbosch.detekt.Detekt
import org.apache.commons.io.output.ByteArrayOutputStream
import java.time.Instant
Expand Down Expand Up @@ -94,6 +95,20 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
val abiCodes = mapOf(
"armabi-v7a" to 1,
"arm64-v8a" to 2,
"x86" to 3,
"x86_64" to 4,
)
androidComponents {
onVariants { variant ->
variant.outputs.forEach { output ->
val abi = output.filters.find { it.filterType == FilterConfiguration.FilterType.ABI }?.identifier
output.versionCode.set((output.versionCode.orNull ?: 0) * 10 + (abiCodes[abi] ?: 0))
}
}
}
}

room {
Expand Down

0 comments on commit 85cd1e5

Please sign in to comment.