Migrate ReactAndroid to use Buck's new java_annotation_processor rule
Reviewed By: asp2insp Differential Revision: D4654756 fbshipit-source-id: d98d55786d84cf02234699a260e8750305982267
This commit is contained in:
parent
4203c9c837
commit
0a7427f599
|
@ -46,38 +46,28 @@ original_android_library=android_library
|
|||
def android_library(
|
||||
name,
|
||||
deps=[],
|
||||
annotation_processors=[],
|
||||
annotation_processor_deps=[],
|
||||
plugins=[]
|
||||
*args,
|
||||
**kwargs):
|
||||
|
||||
if react_native_target('java/com/facebook/react/uimanager/annotations:annotations') in deps and name != 'processing':
|
||||
react_property_processors = [
|
||||
'com.facebook.react.processing.ReactPropertyProcessor',
|
||||
]
|
||||
react_property_processor_deps = [
|
||||
react_property_plugins = [
|
||||
react_native_target('java/com/facebook/react/processing:processing'),
|
||||
]
|
||||
|
||||
annotation_processors = list(set(annotation_processors + react_property_processors))
|
||||
annotation_processor_deps = list(set(annotation_processor_deps + react_property_processor_deps))
|
||||
plugins = list(set(plugins + react_property_plugins))
|
||||
|
||||
if react_native_target('java/com/facebook/react/module/annotations:annotations') in deps and name != 'processing':
|
||||
react_module_processors = [
|
||||
'com.facebook.react.module.processing.ReactModuleSpecProcessor',
|
||||
]
|
||||
react_module_processor_deps = [
|
||||
react_module_plugins = [
|
||||
react_native_target('java/com/facebook/react/module/processing:processing'),
|
||||
]
|
||||
|
||||
annotation_processors = list(set(annotation_processors + react_module_processors))
|
||||
annotation_processor_deps = list(set(annotation_processor_deps + react_module_processor_deps))
|
||||
plugins = list(set(plugins + react_module_plugins))
|
||||
|
||||
original_android_library(
|
||||
name=name,
|
||||
deps=deps,
|
||||
annotation_processors=annotation_processors,
|
||||
annotation_processor_deps=annotation_processor_deps,
|
||||
plugins=plugins,
|
||||
*args,
|
||||
**kwargs)
|
||||
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
include_defs("//ReactAndroid/DEFS")
|
||||
|
||||
java_library(
|
||||
java_annotation_processor(
|
||||
name = "processing",
|
||||
srcs = glob(["*.java"]),
|
||||
source = "7",
|
||||
target = "7",
|
||||
processor_class = "com.facebook.react.module.processing.ReactModuleSpecProcessor",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
":processing-lib",
|
||||
],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "processing-lib",
|
||||
srcs = glob(["*.java"]),
|
||||
source = "7",
|
||||
target = "7",
|
||||
deps = [
|
||||
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
|
||||
react_native_dep("third-party/java/javapoet:javapoet"),
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
include_defs("//ReactAndroid/DEFS")
|
||||
|
||||
java_library(
|
||||
java_annotation_processor(
|
||||
name = "processing",
|
||||
srcs = glob(["*.java"]),
|
||||
source = "7",
|
||||
target = "7",
|
||||
processor_class = "com.facebook.react.processing.ReactPropertyProcessor",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
":processing-lib",
|
||||
],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "processing-lib",
|
||||
srcs = glob(["*.java"]),
|
||||
source = "7",
|
||||
target = "7",
|
||||
deps = [
|
||||
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
|
||||
react_native_dep("third-party/java/javapoet:javapoet"),
|
||||
|
|
Loading…
Reference in New Issue