xref: /aosp_15_r20/external/kotlinx.serialization/rules/r8.pro (revision 57b5a4a64c534cf7f27ac9427ceab07f3d8ed3d8)
1# Rule to save runtime annotations on serializable class.
2# If the R8 full mode is used, annotations are removed from classes-files.
3#
4# For the annotation serializer, it is necessary to read the `Serializable` annotation inside the serializer<T>() function - if it is present,
5# then `SealedClassSerializer` is used, if absent, then `PolymorphicSerializer'.
6#
7# When using R8 full mode, all interfaces will be serialized using `PolymorphicSerializer`.
8#
9# see https://github.com/Kotlin/kotlinx.serialization/issues/2050
10
11 -if @kotlinx.serialization.Serializable class **
12 -keep, allowshrinking, allowoptimization, allowobfuscation, allowaccessmodification class <1>
13