Skip to content

Commit

Permalink
Refactor gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
moneytoo committed Dec 14, 2024
1 parent fae592b commit ffadde9
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,14 @@ android {
versionCode 180
versionName "0.${versionCode}"
archivesBaseName = "Just.Player.v${versionName}"
switch (abiFilter) {
case "x86":
versionCode = versionCode * 10 + 1
break
case "x86_64":
versionCode = versionCode * 10 + 2
break
case "armeabi-v7a":
versionCode = versionCode * 10 + 3
break
case "arm64-v8a":
versionCode = versionCode * 10 + 4
break
}
ndk {
abiFilters = abiFilter ? [abiFilter] : []
if (abiFilter) {
def abiCodeMap = ["x86": 1, "x86_64": 2, "armeabi-v7a": 3, "arm64-v8a": 4]
versionCode = versionCode * 10 + abiCodeMap[abiFilter]
ndk {
abiFilters abiFilter
}
}
}

buildTypes {
release {
minifyEnabled false
Expand Down Expand Up @@ -75,8 +64,20 @@ android {
setIgnore(true)
}
}
applicationVariants.all { variant ->
if (variant.buildType.name == "release" && variant.flavorName == "latestUniversalFull") {
variant.outputs.all { output ->
output.outputFileName = "${archivesBaseName}.apk"
}
}
if (variant.buildType.name == "release" && variant.flavorName == "legacyUniversalFull") {
variant.outputs.all { output ->
output.outputFileName = "${archivesBaseName}-legacy.apk"
}
}
}
androidComponents {
onVariants(selector().withFlavor(new kotlin.Pair("distribution", "amazon")), {
onVariants(selector().withFlavor("distribution", "amazon"), {
packaging.dex.useLegacyPackaging.set(false)
packaging.jniLibs.excludes.add('lib/armeabi-v7a/*_neon.so')
})
Expand Down

0 comments on commit ffadde9

Please sign in to comment.