mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-02 18:26:49 +01:00
Enable minification for release build.
This reduces result apk size around 2x times. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
3de18ed282
commit
7bf39ca877
@ -19,8 +19,11 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||||
|
'minify/proguard-okhttp.pro',
|
||||||
|
'minify/proguard-retrofit.pro',
|
||||||
|
'minify/proguard-jackson.pro'
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
|
11
ultrasonic/minify/proguard-jackson.pro
Normal file
11
ultrasonic/minify/proguard-jackson.pro
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#### From Jackson
|
||||||
|
|
||||||
|
-keepattributes *Annotation*,EnclosingMethod,Signature
|
||||||
|
-keepnames class com.fasterxml.jackson.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-keepnames interface com.fasterxml.jackson.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-dontwarn com.fasterxml.jackson.databind.**
|
||||||
|
-keep class org.codehaus.** { *; }
|
8
ultrasonic/minify/proguard-okhttp.pro
Normal file
8
ultrasonic/minify/proguard-okhttp.pro
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#### From okhttp
|
||||||
|
|
||||||
|
-dontwarn okhttp3.**
|
||||||
|
-dontwarn okio.**
|
||||||
|
-dontwarn javax.annotation.**
|
||||||
|
-dontwarn org.conscrypt.**
|
||||||
|
# A resource is loaded with a relative path so the package of this class must be preserved.
|
||||||
|
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
10
ultrasonic/minify/proguard-retrofit.pro
Normal file
10
ultrasonic/minify/proguard-retrofit.pro
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#### From retrofit
|
||||||
|
|
||||||
|
# Retain generic type information for use by reflection by converters and adapters.
|
||||||
|
-keepattributes Signature
|
||||||
|
# Retain service method parameters.
|
||||||
|
-keepclassmembernames,allowobfuscation interface * {
|
||||||
|
@retrofit2.http.* <methods>;
|
||||||
|
}
|
||||||
|
# Ignore annotation used for build tooling.
|
||||||
|
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
Loading…
x
Reference in New Issue
Block a user