From 173d3a4abcfe6e46e5f375d21fd7823795c16973 Mon Sep 17 00:00:00 2001 From: Sota Ogo Date: Thu, 2 Dec 2021 19:17:02 -0800 Subject: [PATCH] Add a dependency to the native component example added to RNTester (#32693) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32693 Changelog: [Internal] this diff adds dependecies to the buck files so that an internal app that referes RNtester will work as intended. Reviewed By: cortinico Differential Revision: D32778338 fbshipit-source-id: d4703903c2227283fe9c70f02bb7da420d936fbb --- packages/rn-tester/BUCK | 60 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/packages/rn-tester/BUCK b/packages/rn-tester/BUCK index 3e577b4b788..234afeafacd 100644 --- a/packages/rn-tester/BUCK +++ b/packages/rn-tester/BUCK @@ -14,6 +14,7 @@ load( "YOGA_APPLE_TARGET", "js_glob", "make_resource_glob", + "react_fabric_component_plugin_provider", "react_module_plugin_providers", "rn_apple_library", "rn_extra_build_flags", @@ -49,7 +50,6 @@ rn_library( [ "js", "NativeModuleExample", - "NativeComponentExample", "RCTTest", ], excludes = [ @@ -63,6 +63,7 @@ rn_library( skip_processors = True, visibility = ["PUBLIC"], deps = [ + ":MyNativeViewSpec", "//xplat/js:node_modules__nullthrows", "//xplat/js/RKJSModules/Libraries/Core:Core", "//xplat/js/RKJSModules/vendor/react:react", @@ -77,6 +78,9 @@ fb_native.filegroup( [ "**/*NativeComponent.js", ], + exclude = [ + "NativeComponentExample/**/*", + ], ), visibility = ["PUBLIC"], ) @@ -274,3 +278,57 @@ rn_apple_library( YOGA_APPLE_TARGET, ], ) + +rn_xplat_cxx_library2( + name = "NativeComponentExample", + plugins_only = True, + srcs = glob( + [ + "NativeComponentExample/**/*.m", + "NativeComponentExample/**/*.mm", + ], + ), + headers = glob( + [ + "NativeComponentExample/**/*.h", + ], + ), + header_namespace = "", + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++17", + "-Wall", + ], + contacts = ["oncall+react_native@xmail.facebook.com"], + labels = [ + "supermodule:xplat/default/public.react_native.infra", + ], + plugins = [ + react_fabric_component_plugin_provider("RNTMyNativeView", "RNTMyNativeViewCls"), + ], + plugins_header = "RCTFabricComponentsPlugins.h", + reexport_all_header_dependencies = False, + visibility = ["PUBLIC"], + deps = [ + ":generated_components-MyNativeViewSpec", + "//xplat/js/react-native-github:RCTFabricComponentViewsBase", + "//xplat/js/react-native-github:ReactInternal", + ], +) + +rn_library( + name = "MyNativeViewSpec", + srcs = js_glob( + [ + "NativeComponentExample", + ], + ), + codegen_components = True, + labels = ["supermodule:xplat/default/public.react_native.ui.misc"], + visibility = ["PUBLIC"], + deps = [ + "//xplat/js/RKJSModules/vendor/react:react", + "//xplat/js/react-native-github:react-native", + ], +)