Skip to content

Commit

Permalink
ProGruard configuration, enable R8
Browse files Browse the repository at this point in the history
R8 works after config updates, reenable as R8 will be required eventually
  • Loading branch information
gerhardol committed Aug 1, 2020
1 parent 2040acf commit be76188
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions app/proguard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# Picasso
-dontnote com.squareup.**

-dontwarn android.support.**
#-dontwarn android.support.**
-dontwarn java.lang.**
-dontwarn org.codehaus.**
-dontwarn com.google.**
Expand Down Expand Up @@ -138,28 +138,28 @@

## Android architecture components: Lifecycle
# LifecycleObserver's empty constructor is considered to be unused by proguard
-keepclassmembers class * implements android.arch.lifecycle.LifecycleObserver {
-keepclassmembers class * implements androidx.lifecycle.LifecycleObserver {
<init>(...);
}
# ViewModel's empty constructor is considered to be unused by proguard
-keepclassmembers class * extends android.arch.lifecycle.ViewModel {
-keepclassmembers class * extends androidx.lifecycle.ViewModel {
<init>(...);
}

# keep Lifecycle State and Event enums values
-keepclassmembers class android.arch.lifecycle.Lifecycle$State { *; }
-keepclassmembers class android.arch.lifecycle.Lifecycle$Event { *; }
-keepclassmembers class androidx.lifecycle.Lifecycle$State { *; }
-keepclassmembers class androidx.lifecycle.Lifecycle$Event { *; }
# keep methods annotated with @OnLifecycleEvent even if they seem to be unused
# (Mostly for LiveData.LifecycleBoundObserver.onStateChange(), but who knows)
-keepclassmembers class * {
@android.arch.lifecycle.OnLifecycleEvent *;
@androidx.lifecycle.OnLifecycleEvent *;
}

-keepclassmembers class * implements android.arch.lifecycle.LifecycleObserver {
-keepclassmembers class * implements androidx.lifecycle.LifecycleObserver {
<init>(...);
}

-keep class * implements android.arch.lifecycle.LifecycleObserver {
-keep class * implements androidx.lifecycle.LifecycleObserver {
<init>(...);
}
-keepclassmembers class android.arch.** { *; }
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
android.enableR8=false
# R8 is not displaying warnings for configuration issues, proguard may be required
# Build with ./gradlew app:minifyLatestReleaseWithProguard
#android.enableR8=false
android.enableJetifier=true
android.useAndroidX=true

0 comments on commit be76188

Please sign in to comment.