Merge pull request #175 from ultrasonic/enable-minify-for-release

Enable minify for release
This commit is contained in:
Yahor Berdnikau 2018-03-18 18:22:55 +01:00 committed by GitHub
commit bf6026087a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 4 deletions

View File

@ -16,6 +16,9 @@ jobs:
- run: - run:
name: checkstyle name: checkstyle
command: ./gradlew -Pqc ktlintCheck command: ./gradlew -Pqc ktlintCheck
- run:
name: static analysis
command: ./gradlew -Pqc detektCheck
- run: - run:
name: build name: build
command: ./gradlew assembleDebug command: ./gradlew assembleDebug
@ -29,8 +32,8 @@ jobs:
name: lint name: lint
command: ./gradlew lint command: ./gradlew lint
- run: - run:
name: static analysis name: assemble release build
command: ./gradlew -Pqc detektCheck command: ./gradlew assembleRelease
- save_cache: - save_cache:
paths: paths:
- ~/.gradle - ~/.gradle

View File

@ -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

View 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.** { *; }

View 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

View 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