Skip to content

Commit

Permalink
Migrate ReactAndroid to use Buck's new java_annotation_processor rule
Browse files Browse the repository at this point in the history
Reviewed By: asp2insp

Differential Revision: D4654756

fbshipit-source-id: d98d55786d84cf02234699a260e8750305982267
  • Loading branch information
jkeljo authored and facebook-github-bot committed Mar 14, 2017
1 parent 4203c9c commit 0a7427f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
22 changes: 6 additions & 16 deletions ReactAndroid/DEFS
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
16 changes: 12 additions & 4 deletions ReactAndroid/src/main/java/com/facebook/react/processing/BUCK
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down

0 comments on commit 0a7427f

Please sign in to comment.