Guardsquare/proguard

Annotation with parameters

queeg500 opened this issue · 0 comments

Hi,

I might be missing something in the documentation but I am struggling to keep annotated fields where the annotation has parameters. We are using a CLI library which annotations fields with command line arguments, descriptions etc. So my java code is something like

@picocli.CommandLine.Option(names = { "--argument", "-a" }, description = "An argument", required = true)  
private String testArgument;

and I want to keep 'testArgument' as this is shown to the user when they input an incorrect command, the classes do not always share an interface or extension point. With the following I can keep the field if I change the annotation to @java.lang.Deprecated

-keepclassmembers class * {
    @java.lang.Deprecated <fields>;
}

so I can't be too far away but following the Option with variations on '', '...', '??' to have it match the parameters don't appear to work. Is this something that is supported?

Thank you.