Files
react-native/packages/react-native-codegen/BUCK
T
Michał Osadnik 6e73304401 Follow up e2e testing mechanism with real tests (#25680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25680

This diff's adding real e2e tests for skeleton added in previous diff.

It verifies many cases for codegen, which should generate cpp code.

Reviewed By: rickhanlonii

Differential Revision: D16279810

fbshipit-source-id: 4441dd0ed4d95476e4071fbd654ebfb8a47ecbfc
2019-07-17 06:21:48 -07:00

119 lines
3.1 KiB
Python

load("@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", "APPLE")
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_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")
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(
name = "codegen_tests",
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",
":generated_modules-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",
":generated_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"],
)