Skip to content

Commit

Permalink
Keep names on @NestedSealed types (#413)
Browse files Browse the repository at this point in the history
This ensures that the annotations themselves aren't stripped from the class descriptor and thus available at runtime.
  • Loading branch information
ZacSweers authored Apr 16, 2023
1 parent 949f273 commit b31ac71
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Keep NestedSealed for runtime use
# Keep NestedSealed for runtime use.
-keep interface dev.zacsweers.moshix.sealed.annotations.NestedSealed { *; }

# Keep signatures for typed annotated with NestedSealed. This ensures that the annotation, while kept generally above,
# isn't stripped from the use on the class.
-keepnames @dev.zacsweers.moshix.sealed.annotations.NestedSealed class **

# Keep generic signatures and annotations at runtime.
# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature.
-keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod

0 comments on commit b31ac71

Please sign in to comment.