-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Provide proguard/r8 rules #1929
base: main
Are you sure you want to change the base?
Conversation
9353015
to
f9a5f55
Compare
If these resources are present, does that mean that How do we test that these rules are working correctly? |
Note: This repo needs
See also
|
Sorry, I should have been a bit more explicit about my concerns. This PR is adding 4 different ProGuard configuration files. Is there a way to add an automated test that will check that each of those files is correct? I think it will be hard to maintain the files otherwise. |
Any update to this one? r8 rules should be included its 2022 now |
Default rules have been added by #2397 and will be available in the next version, so this pull request here might be obsolete. @ganadist and everyone else who wanted this feature, could you please try building Gson locally and see if the snapshot version of Gson correctly applies the rules. Any feedback regarding these rules, such as if something is missing or is too coarse, is highly appreciated! Also keep in mind that these default library rules cannot cover everything; if you have specific classes or fields which should be preserved and you are not using |
Currently, developer needs to add proguard rules manually.
But rules can be provided as resource and proguard/r8 will read and apply automatically.
Rules are copied from https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg
gson/src/main/resources/META-INF/proguard/gson.pro: proguard rules for java applications
gson/src/main/resources/META-INF/com.android.tools/proguard/gson.pro : proguard rules for Android Gradle Plugin
gson/src/main/resources/META-INF/com.android.tools/r8/gson.pro : R8 rules for Android Gradle Plugin
gson/src/main/resources/META-INF/com.android.tools/r8-from-3.0.0/gson.pro : Additional R8 rules for 3.0 or higher