Skip to content

Commit 40d83b5

Browse files
committed
Add a Proguard rule for the missing serialization classes (#336)
This permits using kotlinx-datetime without kotlinx-serialization on Android without complaints from the build tooling. Fixes #297
1 parent 12183f5 commit 40d83b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# We depend on kotlinx-serialization as compileOnly.
2+
# If the serializers don't get used, the library works properly even without the
3+
# kotlinx-serialization dependency, but Proguard emits warnings about datetime
4+
# classes mentioning some serialization-related entities.
5+
# These rules should not cause problems: if a project actually relies on
6+
# serialization, then much more than just these two classes will be required,
7+
# so telling Proguard not to worry if these two are missing will not prevent it
8+
# from emitting errors for code that does use serialization but somehow forgot
9+
# to depend on it.
10+
-dontwarn kotlinx.serialization.KSerializer
11+
-dontwarn kotlinx.serialization.Serializable

0 commit comments

Comments
 (0)