Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proguard rules for R8 fullMode #455

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ If you would like to get the most recent code in a jar, clone the project and ru

You may also add the library as an Android Library to your project. All the library files live in ```library```.

### R8 / ProGuard
The specific rules are [already bundled](library/src/main/resources/META-INF/proguard/autocomplete.pro) into the JAR which can be interpreted by R8 automatically.

Creating your auto complete view
--------------------------------

Expand Down
6 changes: 5 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
all {
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ POM_DEVELOPER_ID=mgod
POM_DEVELOPER_NAME=Marshall Weir
android.useAndroidX=true
android.enableJetifier=false
# Enable R8 full mode.
android.enableR8.fullMode=true
org.gradle.jvmargs=-Xmx4096m "-XX:MaxMetaspaceSize=512m"
3 changes: 3 additions & 0 deletions library/src/main/resources/META-INF/proguard/autocomplete.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Keep generic types for R8 fullMode.
-keep,allowobfuscation,allowshrinking class com.tokenautocomplete.TokenCompleteTextView
-keep,allowobfuscation,allowshrinking class * extends com.tokenautocomplete.TokenCompleteTextView
Loading