v0.7.1c: switched to experimental R8 optimizer which replaces proguard.

A few things to note:
- R8 is currently experimental, but is becoming default in AS 3.4
- R8 results in a decent decrease in bytecode size
- R8 necessitates switching off proguard-optimize, as that config nukes
  the line number table even with -keepattributes LineNumberTable.
  Hopefully that will be fixed and optimize can be re-enabled for
  even more size savings.
- No instability has been observed, but if any crops up I will revert
This commit is contained in:
Evan Debenham
2019-01-12 16:12:52 -05:00
parent 61c85b031e
commit 5e759d4f1f
3 changed files with 5 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ android {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

View File

@@ -2,10 +2,4 @@
-keepnames class com.shatteredpixel.** { *; }
-keepnames class com.watabou.** { *; }
-keep class com.shatteredpixel.shatteredpixeldungeon { *; }
-keep class com.watabou.noosa.game { *; }
-keepattributes SourceFile,LineNumberTable
# overrides default in proguard-android-optimize.txt, which is:
# -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
# This is because code/simplification/arithmetic is safe to use on android 2.0+
-optimizations !code/simplification/cast,!field/*,!class/merging/*
-keep class com.watabou.noosa.game { *; }

3
gradle.properties Normal file
View File

@@ -0,0 +1,3 @@
# enables the new experimental R8 optimizer
# this will be the default starting in android studio 3.4
android.enableR8 = true