Release mode: add some codeoptimization to look how it behaves
This commit is contained in:
parent
7a5c9ae211
commit
1f43dfbc6e
2 changed files with 33 additions and 7 deletions
|
|
@ -49,13 +49,13 @@ android {
|
||||||
named("release") {
|
named("release") {
|
||||||
resValue("string", "app_name", "ElementX")
|
resValue("string", "app_name", "ElementX")
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
isMinifyEnabled = false
|
|
||||||
setProguardFiles(
|
postprocessing {
|
||||||
listOf(
|
isRemoveUnusedCode = true
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
isObfuscate = false
|
||||||
"proguard-rules.pro"
|
isOptimizeCode = true
|
||||||
)
|
proguardFiles("proguard-rules.pro")
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
register("nightly") {
|
register("nightly") {
|
||||||
|
|
|
||||||
26
app/proguard-rules.pro
vendored
Normal file
26
app/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.kts.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# JNA
|
||||||
|
-keep class com.sun.jna.** { *; }
|
||||||
|
-keep class * implements com.sun.jna.** { *; }
|
||||||
|
|
||||||
|
# kotlinx.serialization
|
||||||
|
|
||||||
|
# Kotlin serialization looks up the generated serializer classes through a function on companion
|
||||||
|
# objects. The companions are looked up reflectively so we need to explicitly keep these functions.
|
||||||
|
-keepclasseswithmembers class **.*$Companion {
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
# If a companion has the serializer function, keep the companion field on the original type so that
|
||||||
|
# the reflective lookup succeeds.
|
||||||
|
-if class **.*$Companion {
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
-keepclassmembers class <1>.<2> {
|
||||||
|
<1>.<2>$Companion Companion;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue