Ensure runtime-visible annotations are kept

With R8 full mode, these annotations must be explicitly kept as
attributes. Also keep annotation defaults as they may be used at
runtime.

Test: m + presubmit
Bug: 215530220
Change-Id: Ibab630cd8498c5789ebcad6785fda24967df4d61
This commit is contained in:
Jared Duke
2022-07-25 16:49:39 -07:00
parent f68794510f
commit 3837a945b7

View File

@@ -2,6 +2,11 @@
# that isn't explicitly part of the API
-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
# Annotations are implemented as attributes, so we have to explicitly keep them.
# Keep all runtime-visible annotations like RuntimeVisibleParameterAnnotations
# and RuntimeVisibleTypeAnnotations, as well as associated defaults.
-keepattributes RuntimeVisible*Annotation*,AnnotationDefault
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();