Skip to content

Commit 3750b39

Browse files
v5.0.0-beta3
1 parent da91c71 commit 3750b39

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

android/build.gradle.kts

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.android.build.api.variant.FilterConfiguration
2+
13
plugins {
24
id("com.android.application")
35
id("org.jetbrains.kotlin.android")
@@ -6,6 +8,16 @@ plugins {
68
kotlin {
79
jvmToolchain(24)
810
}
11+
12+
ext {
13+
set("abiCodes", mapOf(
14+
"armeabi-v7a" to 1,
15+
"x86" to 2,
16+
"x86_64" to 3,
17+
"arm64-v8a" to 4
18+
))
19+
}
20+
921
android {
1022
namespace = "project.pipepipe.app"
1123
compileSdk = 36
@@ -14,11 +26,20 @@ android {
1426
applicationId = "project.pipepipe.app"
1527
minSdk = 26
1628
targetSdk = 36
17-
versionCode = 2001
18-
versionName = "5.0.0-beta2"
29+
versionCode = 2002
30+
versionName = "5.0.0-beta3"
1931
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2032
}
2133

34+
splits {
35+
abi {
36+
reset()
37+
isEnable = true
38+
isUniversalApk = true // Generate a universal APK in addition to ABI-specific APKs
39+
include("armeabi-v7a", "arm64-v8a", "x86_64", "x86")
40+
}
41+
}
42+
2243
buildTypes {
2344
release {
2445
isMinifyEnabled = true
@@ -46,14 +67,26 @@ android {
4667
excludes += "/META-INF/INDEX.LIST"
4768
excludes += "/META-INF/io.netty.versions.properties"
4869
}
70+
jniLibs {
71+
useLegacyPackaging = true
72+
}
4973
}
5074

51-
packagingOptions { jniLibs { useLegacyPackaging = true } }
52-
5375
applicationVariants.all {
76+
val abiCodesMap = project.ext.get("abiCodes") as Map<*, *>
77+
val baseVersionCode = defaultConfig.versionCode ?: 0
78+
5479
outputs.all {
55-
(this as com.android.build.gradle.internal.api.BaseVariantOutputImpl).outputFileName =
56-
"PipePipe-${versionName}-${buildType.name}.apk"
80+
val outputImpl = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
81+
val abiFilter = outputImpl.getFilter(com.android.build.OutputFile.ABI)
82+
if (abiFilter != null) {
83+
outputImpl.outputFileName = "PipePipe-${versionName}-${abiFilter}-${buildType.name}.apk"
84+
val abiCode = abiCodesMap[abiFilter] as? Int ?: 0
85+
(outputImpl as com.android.build.gradle.api.ApkVariantOutput).versionCodeOverride = 100 * baseVersionCode + abiCode
86+
} else {
87+
outputImpl.outputFileName = "PipePipe-${versionName}-universal-${buildType.name}.apk"
88+
(outputImpl as com.android.build.gradle.api.ApkVariantOutput).versionCodeOverride = 100 * baseVersionCode
89+
}
5790
}
5891
}
5992
}

android/proguard-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@
5656
# ============ Debugging (Optional) ============
5757
# -printconfiguration build/outputs/mapping/configuration.txt
5858
# -printusage build/outputs/mapping/usage.txt
59+
60+
61+
-keep class org.apache.commons.compress.** { *; }
62+
-dontwarn org.apache.commons.compress.**

0 commit comments

Comments
 (0)