kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Current proguard documentation is unclear

Open fsgjlp opened this issue 2 years ago • 3 comments

Here are two different versions of proguard file with different rules and descriptions. Please make them similar, or better yet, keep only one version of proguard rules.

fsgjlp avatar Apr 11 '22 22:04 fsgjlp

They do different things, though. That's why they are different.

The first one "keeps serializers for all serializable classes that are retained after shrinking". This is what I imagine fits the bill for the majority of users out there, and why it is currently listed first.

If you want more shrinking, this requires more configuration:

In case you want to exclude serializable classes that are used, but never serialized at runtime

Perhaps it would help if you could elaborate what is unclear about this. Requesting to make them similar ignores the fact that they are different for a reason. How do you feel we can make this distinction clearer?

Whathecode avatar Apr 12 '22 14:04 Whathecode

Libraries like OkHttp come bundled with proguard rules. Shouldn't serialization lib do this, too?

digitalheir avatar Jun 17 '22 12:06 digitalheir

@digitalheir, I think it's worth considering this possibility.

However, the rules from okhttp are significantly different, they mostly contain dontwarn. The rules from the library are stricter, they control the obfuscation and shrinking of classes. Also, in general, it is impossible to solve the problem with custom companion objects, you will need to add your own rules.

shanshin avatar Jun 17 '22 12:06 shanshin