From b7055944a9db2ff96efa8faabe97f58c4cb4dd6d Mon Sep 17 00:00:00 2001 From: Gabriel Ittner Date: Tue, 25 Sep 2018 20:52:05 +0200 Subject: [PATCH] Proguard config: keep field names of annotated enums (#691) closes #689 --- moshi/src/main/resources/META-INF/proguard/moshi.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/moshi/src/main/resources/META-INF/proguard/moshi.pro b/moshi/src/main/resources/META-INF/proguard/moshi.pro index c639bc7..7a1d3d9 100644 --- a/moshi/src/main/resources/META-INF/proguard/moshi.pro +++ b/moshi/src/main/resources/META-INF/proguard/moshi.pro @@ -7,6 +7,12 @@ -keep @com.squareup.moshi.JsonQualifier interface * +# Enum field names are used by the integrated EnumJsonAdapter. +# Annotate enums with @JsonClass(generateAdapter = false) to use them with Moshi. +-keepclassmembernames @com.squareup.moshi.JsonClass class * extends java.lang.Enum { + ; +} + # The name of @JsonClass types is used to look up the generated adapter. -keepnames @com.squareup.moshi.JsonClass class *