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

Update ProGuard rules for Toothpick 3.0 and KTP #370

Closed
zawadz88 opened this issue Sep 17, 2019 · 7 comments
Closed

Update ProGuard rules for Toothpick 3.0 and KTP #370

zawadz88 opened this issue Sep 17, 2019 · 7 comments

Comments

@zawadz88
Copy link
Contributor

Hi,
I'm migrating from TP 2.1.0 to TP 3.0 and I've noticed that some ProGuard rules need updating if you're using @InjectConstructor and KTP delegates instead of @Inject-annotated properties. I didn't find any info about this in the documentation so I'm posting it here.

The following seems to be working for me:

-keepnames @toothpick.InjectConstructor class *
-keepclasseswithmembernames class * { toothpick.ktp.delegate.* *; }
-keepclassmembers class * {
    toothpick.ktp.delegate.* *;
}

in addition to already defined rules. Note: I'm using that on top of the rules mentioned in #330

@stephanenicolas
Copy link
Owner

stephanenicolas commented Sep 17, 2019 via email

@stephanenicolas
Copy link
Owner

@zawadz88 can you make a PR on the proguard file that TP passes to downstream projects please ? I have updated the docs already: https://github.com/stephanenicolas/toothpick/wiki/Proguard-&-TP

@dimsuz
Copy link

dimsuz commented Sep 24, 2019

By the way, are there any plans to put proguard rules inside the library jar's resources? Android's new shrinker R8 (now default) supports this, so even clients who do not use smoothie will receive them, no need for manual addition and supporting wiki page. Moshi, okhttp, retrofit use this feature, it's working great.

Maybe I'll create a PR one day, but currently rather busy, so at least keep this in mind, iirc this isn't a complex thing to do.

@zawadz88
Copy link
Contributor Author

@stephanenicolas I'll try to prepare something within a week :)

@stephanenicolas
Copy link
Owner

stephanenicolas commented Sep 24, 2019 via email

@stephanenicolas
Copy link
Owner

This has been addressed.

@RumataEstorish
Copy link

When migrating to gradle plugin 7.0 had to add
-keep @javax.inject.Qualifier public class *
to keep qualifiers working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants