Change ProGuard rules to suppress the library causing the problem #394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This re-fixes #297. cc @dkhalanskyjb @MarcelReiter @LouisCAD
Why?
The current solution on
master
is not broken, but it references the wrong library. Why? There are other libraries out there, in similar shoes to datetime, their problems will also be suppressed, by this library. This library is by no means authoritative to make a decision how other libraries should usekotlinx.serialization
. Therefore it should be configuring ProGuard/R8 for itself. The other libraries need to be given a chance to detect and fix their own problems.Background
In general, if a user decides to suppress
kotlinx.serialization
with-dontwarn
s in their project, that's a decision, but that's an end user decision, not a library one, it shouldn't apply to all users in the world.How?
The warning mentions that
Instant
is usingSerializable
, in this caseInstant
is doing the "wrong" thing, and therefore it shouldn't beSerializable
that's being suppressed. Ideally-dontwarn
would be powerful enough to combine the suppression ofdatetime
+serialization
, but until then we should be more specific about the suppression. The specificity in this case isdatetime
, becauseserialization
is a more generic library.Testing
I used the https://github.com/MarcelReiter/dateTimeTest to confirm the fix. It only uses Instant, but each of the datetime primitives use
@Serializable
so the warning will apply to all, same with allkotlinx.datetime.serializers
classes.