mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3af21381df
Summary: This commit: * Generate Fabric component Java files along side Java NativeModule specs, when `USE_FABRIC=1` is set * Adjust the component codegen to place output files in a subdir based on package name * Adjust existing Buck targets to filter the right nativemodule vs component java files (this avoids duplicated symbols) * Compiles the Java output during build time on RNTester/ReactAndroid (Gradle) Not in this commit: * Fabric C++ files * Removing checked-in generated component files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25416614 fbshipit-source-id: fd670ead2198c9b5a65812c692b7aed9f3d7cd58
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
|
load(
|
|
"//tools/build_defs/oss:rn_codegen_defs.bzl",
|
|
"rn_codegen_components",
|
|
"rn_codegen_modules",
|
|
)
|
|
load(
|
|
"//tools/build_defs/oss:rn_defs.bzl",
|
|
"react_native_root_target",
|
|
)
|
|
|
|
fb_native.genrule(
|
|
name = "react_native_codegen_schema",
|
|
srcs = glob(
|
|
[
|
|
"**/*.js",
|
|
],
|
|
exclude = [
|
|
"**/__tests__/**/*",
|
|
],
|
|
),
|
|
cmd = "$(exe {}) $OUT $SRCS".format(react_native_root_target("packages/react-native-codegen:write_to_json")),
|
|
out = "schema.json",
|
|
labels = ["codegen_rule"],
|
|
)
|
|
|
|
rn_codegen_modules(
|
|
name = "FBReactNativeSpec",
|
|
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
|
|
native_module_spec_name = "FBReactNativeSpec",
|
|
schema_target = ":react_native_codegen_schema",
|
|
)
|
|
|
|
rn_codegen_components(
|
|
name = "FBReactNativeComponentSpec",
|
|
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
|
|
schema_target = ":react_native_codegen_schema",
|
|
)
|