Skip to content

Commit c956076

Browse files
committed
[AND] Enable minifying release build
1 parent b3830cd commit c956076

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

androidApp/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ android {
4747

4848
buildTypes {
4949
getByName("release") {
50-
isMinifyEnabled = false
50+
isMinifyEnabled = true
51+
isShrinkResources = true
52+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
5153
}
5254
}
5355

androidApp/proguard-rules.pro

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
22+
23+
-keepattributes *Annotation*, InnerClasses
24+
-dontnote kotlinx.serialization.SerializationKt
25+
-keep,includedescriptorclasses class me.moallemi.kmpshowcase.**$$serializer { *; }
26+
-keepclassmembers class me.moallemi.kmpshowcase.** {
27+
*** Companion;
28+
}
29+
-keepclasseswithmembers class me.moallemi.kmpshowcase.** {
30+
kotlinx.serialization.KSerializer serializer(...);
31+
}
32+
33+
-keep class me.moallemi.kmpshowcase.shared.domain.** { *;}
34+
35+
# Remove all logs
36+
-assumenosideeffects class android.util.Log {
37+
public static *** v(...);
38+
public static *** d(...);
39+
public static *** i(...);
40+
public static *** w(...);
41+
public static *** e(...);
42+
}

0 commit comments

Comments
 (0)