简体   繁体   English

Java Proguard保留具有FXML注释的字段和方法的名称

[英]Java proguard keep name of field and method that have FXML Annotation

i need to keep method and field name that have the @FXML annotation, 我需要保留具有@FXML批注的方法和字段名称,

i try this but it'dosen't work 我尝试了这个但是没用

-keepclasseswithmembers class * {
  @proguard.annotation.FXML <methods>;
}
-keepclasseswithmembers class * {
  @proguard.annotation.FXML <methods>;
}

Only tells Prodguard not to rename Methods that are annotaded with FXML. 仅告诉Prodguard不要重命名FXML注释的方法。 You also need to tell it not to remove the FXML attribute: 您还需要告诉它不要删除FXML属性:

-keepattributes javafx.fxml.FXML

You can also tell ProGuard to adapt the fxml files in your application with 您还可以告诉ProGuard使用以下命令修改应用程序中的fxml文件:

-adaptresourcefilecontents **.fxml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM