简体   繁体   English

如何在Buck中使用自定义注释处理器?

[英]How to use custom Annotation Processors with Buck?

As the title states - I'd like use custom Java Annotation Processors with Buck (eg Dagger 1 / 2). 如标题所示-我想使用带有Buck的自定义Java注释处理器(例如Dagger 1/2)。 Checking out the documentation did not reveal any evident annotation-processing related properties for any Java (or Android) related build rules, and I also couldn't find any examples for this scenario. 查阅文档并没有发现任何与Java(或Android)相关的构建规则的任何明显的与注释处理相关的属性,并且我也找不到这种情况的任何示例。

I did find this issue thread on GitHub though, without any meaningful recent answers. 我确实在GitHub上发现了这个问题线程 ,但没有任何有意义的最新答案。

Is this something that Buck still does not support? 这是Buck仍然不支持的东西吗? In case not, did anyone find a workaround for this? 如果没有,有没有人找到解决方法?

Coneko points you to the code in question in that issue. Coneko将您指向该问题中的相关代码。 Every build rule in Buck has a Description with an Arg class that describes the arguments the rule takes. Buck中的每个构建规则都有一个带有Arg类的描述,该描述描述了该规则采用的参数。 In the case of java_library , there is annotation_processor_deps , annotation_pocessor_params , annotation_processors , and annotation_processor_only . 在的情况下java_library ,有annotation_processor_depsannotation_pocessor_paramsannotation_processorsannotation_processor_only

  • annotation_processor_deps - the set of dependencies needed to run the annotation processor annotation_processor_deps运行注释处理器所需的依赖项集
  • annotation_pocessor_params - the list of arguments to pass to the annotation processors annotation_pocessor_params传递给注解处理器的参数列表
  • annotation_processors - the annotation processors annotation_processors -注释处理器
  • annotation_processor_only - True if this library is only an annotation processor annotation_processor_only如果此库仅是注释处理器,则为True

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

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