perf: increase release optimizations
This commit is contained in:
parent
ac7182fdb0
commit
69ff9b531c
3 changed files with 54 additions and 0 deletions
|
|
@ -31,6 +31,28 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
androidComponents {
|
||||||
|
onVariants(selector().withBuildType("release")) {
|
||||||
|
it.packaging.resources.excludes.apply {
|
||||||
|
// Debug metadata
|
||||||
|
add("/**/*.version")
|
||||||
|
add("/kotlin-tooling-metadata.json")
|
||||||
|
// Kotlin debugging (https://github.com/Kotlin/kotlinx.coroutines/issues/2274)
|
||||||
|
add("/DebugProbesKt.bin")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
resources {
|
||||||
|
// Reflection symbol list (https://stackoverflow.com/a/41073782/13964629)
|
||||||
|
excludes += "/**/*.kotlin_builtins"
|
||||||
|
|
||||||
|
// okhttp3 is used by some lib (no cookies so publicsuffixes.gz can be dropped)
|
||||||
|
excludes += "/okhttp3/**"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
|
|
||||||
26
app/proguard-rules.pro
vendored
26
app/proguard-rules.pro
vendored
|
|
@ -24,3 +24,29 @@
|
||||||
|
|
||||||
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
|
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
|
||||||
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
|
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
|
||||||
|
|
||||||
|
# Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`.
|
||||||
|
# If you have any, uncomment and replace classes with those containing named companion objects.
|
||||||
|
-keepattributes InnerClasses # Needed for `getDeclaredClasses`.
|
||||||
|
#-if @kotlinx.serialization.Serializable class
|
||||||
|
#com.xinto.opencord.gateway.io.OpCode, # <-- List serializable classes with named companions.
|
||||||
|
#com.xinto.opencord.gateway.io.EventName
|
||||||
|
#{
|
||||||
|
# static **$* *;
|
||||||
|
#}
|
||||||
|
-keepnames class <1>$$serializer { # -keepnames suffices; class is kept when serializer() is kept.
|
||||||
|
static <1>$$serializer INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# Repackage classes into the top-level.
|
||||||
|
-repackageclasses
|
||||||
|
|
||||||
|
# Amount of optimization iterations, taken from an SO post
|
||||||
|
-optimizationpasses 5
|
||||||
|
|
||||||
|
# Broaden access modifiers to increase results during optimization
|
||||||
|
-allowaccessmodification
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,19 @@
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
# Android operating system, and which are packaged with your app"s APK
|
# Android operating system, and which are packaged with your app"s APK
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
|
||||||
# Kotlin code style for this project: "official" or "obsolete":
|
# Kotlin code style for this project: "official" or "obsolete":
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
|
|
||||||
|
# Enable R8 full mode.
|
||||||
|
android.enableR8.fullMode=true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue