Skip to content

Instantly share code, notes, and snippets.

@pawelkw
Created January 17, 2019 14:20
Show Gist options
  • Save pawelkw/c5bc377ea4fc6cdbd93bc770c0895879 to your computer and use it in GitHub Desktop.
Save pawelkw/c5bc377ea4fc6cdbd93bc770c0895879 to your computer and use it in GitHub Desktop.
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
-keepclasseswithmembers class * {
@com.squareup.moshi.* <methods>;
}
-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.
-keepclassmembers @com.squareup.moshi.JsonClass class * extends java.lang.Enum {
<fields>;
}
# The name of @JsonClass types is used to look up the generated adapter.
-keepnames @com.squareup.moshi.JsonClass class *
## Retain generated JsonAdapters if annotated type is retained.
-keep public class * extends com.squareup.moshi.JsonAdapter {
<init>(...);
<fields>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment