mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
269ea48822
Summary: Split buck rules for component and modules for our further convenience Reviewed By: rickhanlonii Differential Revision: D16803703 fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861
164 lines
4.3 KiB
Python
164 lines
4.3 KiB
Python
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", "APPLE", "IOS")
|
|
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
|
load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary")
|
|
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_xplat_cxx_library")
|
|
load("@fbsource//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace")
|
|
load("@fbsource//xplat/js/react-native-github/packages/react-native-codegen:DEFS.bzl", "rn_codegen_components", "rn_codegen_modules")
|
|
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_target")
|
|
|
|
fb_native.sh_binary(
|
|
name = "write_to_json",
|
|
main = "src/cli/combine/combine_js_to_schema.sh",
|
|
resources = [
|
|
"fbsource//xplat/js:setup_env",
|
|
"src/cli/combine/combine-js-to-schema.js",
|
|
"src/cli/combine/combine_js_to_schema.sh",
|
|
],
|
|
visibility = ["PUBLIC"],
|
|
)
|
|
|
|
fb_native.sh_binary(
|
|
name = "rn_codegen",
|
|
main = "buck_tests/generate-tests.sh",
|
|
resources = glob(
|
|
[
|
|
"buck_tests/**/*.js",
|
|
"src/**/*.js",
|
|
],
|
|
) + [
|
|
"buck_tests/generate-tests.js",
|
|
"package.json",
|
|
"fbsource//xplat/js:setup_env",
|
|
"yarn.lock",
|
|
],
|
|
visibility = ["PUBLIC"],
|
|
)
|
|
|
|
fb_native.genrule(
|
|
name = "codegen_tests_schema",
|
|
srcs = glob(
|
|
[
|
|
"**/e2e/__test_fixtures__/components/*NativeComponent.js",
|
|
"**/e2e/__test_fixtures__/modules/Native*.js",
|
|
],
|
|
),
|
|
cmd = "$(exe fbsource//xplat/js/react-native-github/packages/react-native-codegen:write_to_json) $OUT $SRCS",
|
|
out = "schema-codegen_tests.json",
|
|
)
|
|
|
|
rn_codegen_components(
|
|
name = "codegen_tests",
|
|
schema_target = ":codegen_tests_schema",
|
|
)
|
|
|
|
rn_codegen_modules(
|
|
name = "codegen_tests",
|
|
native_module_spec_name = "FBReactNativeTestSpec",
|
|
schema_target = ":codegen_tests_schema",
|
|
)
|
|
|
|
fb_xplat_cxx_binary(
|
|
name = "rn_codegen_binary",
|
|
srcs = ["buck_tests/emptyFile.cpp"],
|
|
compiler_flags = [
|
|
"-fexceptions",
|
|
"-frtti",
|
|
"-std=c++14",
|
|
"-Wall",
|
|
],
|
|
platforms = (ANDROID, APPLE),
|
|
preprocessor_flags = [
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
"-DWITH_FBSYSTRACE=1",
|
|
],
|
|
visibility = ["PUBLIC"],
|
|
deps = [
|
|
":generated_components-codegen_tests",
|
|
],
|
|
)
|
|
|
|
rn_android_library(
|
|
name = "rn_codegen_library_java",
|
|
srcs = glob(["**/*.java"]),
|
|
visibility = [
|
|
"PUBLIC",
|
|
],
|
|
deps = [
|
|
react_native_target("java/com/facebook/react/bridge:bridge"),
|
|
react_native_target("java/com/facebook/react/common:common"),
|
|
react_native_target("java/com/facebook/react/views/view:view"),
|
|
react_native_target("java/com/facebook/react/uimanager:uimanager"),
|
|
":generated_components_java-codegen_tests",
|
|
],
|
|
)
|
|
|
|
rn_xplat_cxx_library(
|
|
name = "rn_codegen_library",
|
|
srcs = ["buck_tests/emptyFile.cpp"],
|
|
headers = [],
|
|
compiler_flags = [
|
|
"-fexceptions",
|
|
"-frtti",
|
|
"-std=c++14",
|
|
"-Wall",
|
|
],
|
|
platforms = (ANDROID, APPLE),
|
|
preprocessor_flags = [
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
"-DWITH_FBSYSTRACE=1",
|
|
],
|
|
visibility = [
|
|
"PUBLIC",
|
|
],
|
|
deps = [
|
|
":generated_components-codegen_tests",
|
|
],
|
|
)
|
|
|
|
rn_xplat_cxx_library(
|
|
name = "rn_codegen_library_mm",
|
|
srcs = ["buck_tests/emptyFile.mm"],
|
|
headers = [],
|
|
apple_sdks = (IOS,),
|
|
compiler_flags = [
|
|
"-fexceptions",
|
|
"-frtti",
|
|
"-std=c++14",
|
|
"-Wall",
|
|
],
|
|
platforms = (APPLE),
|
|
preprocessor_flags = [
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
"-DWITH_FBSYSTRACE=1",
|
|
],
|
|
visibility = [
|
|
"PUBLIC",
|
|
],
|
|
deps = [
|
|
":generated_components-codegen_tests",
|
|
":generated_objcpp_modules-codegen_tests",
|
|
],
|
|
)
|
|
|
|
yarn_workspace(
|
|
name = "yarn-workspace",
|
|
srcs = glob(
|
|
["**/*.js"],
|
|
exclude = [
|
|
"**/__fixtures__/**",
|
|
"**/__flowtests__/**",
|
|
"**/__mocks__/**",
|
|
"**/__server_snapshot_tests__/**",
|
|
"**/__tests__/**",
|
|
"**/node_modules/**",
|
|
"**/node_modules/.bin/**",
|
|
"**/.*",
|
|
"**/.*/**",
|
|
"**/.*/.*",
|
|
"**/*.xcodeproj/**",
|
|
"**/*.xcworkspace/**",
|
|
],
|
|
),
|
|
visibility = ["PUBLIC"],
|
|
)
|