Codegen Android: allow generating Fabric Java component files during build time

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
This commit is contained in:
Kevin Gozali 2020-12-09 09:16:41 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 471f6ad358
Коммит 3af21381df
9 изменённых файлов: 192 добавлений и 136 удалений

Просмотреть файл

@ -6,6 +6,7 @@
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(
@ -34,3 +35,9 @@ rn_codegen_modules(
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",
)

Просмотреть файл

@ -128,7 +128,9 @@ def rn_codegen_modules(
##################
fb_native.genrule(
name = generate_module_java_name,
cmd = "cp -r $(location :{})/java $OUT/".format(generate_fixtures_rule_name),
# TODO: support different package name internally.
# Right now, it's hardcoded to `com.facebook.fbreact.specs`.
cmd = "mkdir -p $OUT/com/facebook/fbreact/specs && cp -r $(location :{})/java/com/facebook/fbreact/specs/* $OUT/com/facebook/fbreact/specs/".format(generate_fixtures_rule_name),
out = "src",
labels = ["codegen_rule"],
)
@ -253,7 +255,8 @@ def rn_codegen_modules(
def rn_codegen_components(
name = "",
schema_target = ""):
schema_target = "",
library_labels = []):
generate_fixtures_rule_name = "generate_fixtures_components-{}".format(name)
generate_component_descriptor_h_name = "generate_component_descriptor_h-{}".format(name)
generate_component_hobjcpp_name = "generate_component_hobjcpp-{}".format(name)
@ -328,7 +331,9 @@ def rn_codegen_components(
fb_native.genrule(
name = copy_generated_java_files,
cmd = "mkdir $OUT && find $(location :{}) -name '*.java' -exec cp {{}} $OUT \\;".format(generate_fixtures_rule_name),
# TODO: support different package name internally.
# Right now, it's hardcoded to `com.facebook.react.viewmanagers`.
cmd = "mkdir $OUT && find $(location :{})/java/com/facebook/react/viewmanagers -name '*.java' -exec cp {{}} $OUT \\;".format(generate_fixtures_rule_name),
out = "java",
labels = ["codegen_rule"],
)
@ -371,69 +376,98 @@ def rn_codegen_components(
labels = ["codegen_rule"],
)
# libs
if is_running_buck_project():
rn_xplat_cxx_library(name = "generated_components-{}".format(name), visibility = ["PUBLIC"])
else:
rn_xplat_cxx_library(
name = "generated_components-{}".format(name),
##############
# iOS handling
##############
if not IS_OSS_BUILD:
# iOS Buck build isn't fully working in OSS, so let's skip it for OSS for now.
if is_running_buck_project():
rn_xplat_cxx_library(name = "generated_components-{}".format(name), visibility = ["PUBLIC"])
else:
rn_xplat_cxx_library(
name = "generated_components-{}".format(name),
srcs = [
":{}".format(generate_event_emitter_cpp_name),
":{}".format(generate_props_cpp_name),
":{}".format(generate_shadow_node_cpp_name),
],
headers = [
":{}".format(generate_component_descriptor_h_name),
":{}".format(generate_event_emitter_h_name),
":{}".format(generate_props_h_name),
":{}".format(generate_shadow_node_h_name),
],
header_namespace = "react/renderer/components/{}".format(name),
exported_headers = {
"ComponentDescriptors.h": ":{}".format(generate_component_descriptor_h_name),
"EventEmitters.h": ":{}".format(generate_event_emitter_h_name),
"Props.h": ":{}".format(generate_props_h_name),
"RCTComponentViewHelpers.h": ":{}".format(generate_component_hobjcpp_name),
"ShadowNodes.h": ":{}".format(generate_shadow_node_h_name),
},
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = get_apple_compiler_flags(),
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
ios_exported_headers = {
"ComponentViewHelpers.h": ":{}".format(generate_component_hobjcpp_name),
},
ios_headers = [
":{}".format(generate_component_hobjcpp_name),
],
labels = library_labels + ["codegen_rule"],
platforms = (ANDROID, APPLE, CXX),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [":generated_tests-{}".format(name)],
visibility = ["PUBLIC"],
deps = [
"//third-party/glog:glog",
"//xplat/fbsystrace:fbsystrace",
"//xplat/folly:headers_only",
"//xplat/folly:memory",
"//xplat/folly:molly",
YOGA_CXX_TARGET,
react_native_xplat_target("react/renderer/debug:debug"),
react_native_xplat_target("react/renderer/core:core"),
react_native_xplat_target("react/renderer/graphics:graphics"),
react_native_xplat_target("react/renderer/components/image:image"),
react_native_xplat_target("react/renderer/imagemanager:imagemanager"),
react_native_xplat_target("react/renderer/components/view:view"),
],
)
# Tests
fb_xplat_cxx_test(
name = "generated_tests-{}".format(name),
srcs = [
":{}".format(generate_event_emitter_cpp_name),
":{}".format(generate_props_cpp_name),
":{}".format(generate_shadow_node_cpp_name),
":{}".format(generate_tests_cpp_name),
],
headers = [
":{}".format(generate_component_descriptor_h_name),
":{}".format(generate_event_emitter_h_name),
":{}".format(generate_props_h_name),
":{}".format(generate_shadow_node_h_name),
],
header_namespace = "react/renderer/components/{}".format(name),
exported_headers = {
"ComponentDescriptors.h": ":{}".format(generate_component_descriptor_h_name),
"EventEmitters.h": ":{}".format(generate_event_emitter_h_name),
"Props.h": ":{}".format(generate_props_h_name),
"RCTComponentViewHelpers.h": ":{}".format(generate_component_hobjcpp_name),
"ShadowNodes.h": ":{}".format(generate_shadow_node_h_name),
},
apple_sdks = (IOS, MACOSX),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = get_apple_compiler_flags(),
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
ios_exported_headers = {
"ComponentViewHelpers.h": ":{}".format(generate_component_hobjcpp_name),
},
ios_headers = [
":{}".format(generate_component_hobjcpp_name),
],
labels = ["codegen_rule"],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = library_labels + ["codegen_rule"],
platforms = (ANDROID, APPLE, CXX),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [":generated_tests-{}".format(name)],
visibility = ["PUBLIC"],
deps = [
"//third-party/glog:glog",
"//xplat/fbsystrace:fbsystrace",
"//xplat/folly:headers_only",
"//xplat/folly:memory",
"//xplat/folly:molly",
YOGA_CXX_TARGET,
react_native_xplat_target("react/renderer/debug:debug"),
react_native_xplat_target("react/renderer/core:core"),
react_native_xplat_target("react/renderer/graphics:graphics"),
react_native_xplat_target("react/renderer/components/image:image"),
react_native_xplat_target("react/renderer/imagemanager:imagemanager"),
react_native_xplat_target("react/renderer/components/view:view"),
"//xplat/third-party/gmock:gtest",
":generated_components-{}".format(name),
],
)
##################
# Android handling
##################
if is_running_buck_project():
rn_android_library(name = "generated_components_java-{}".format(name))
else:
@ -442,7 +476,7 @@ def rn_codegen_components(
srcs = [
":{}".format(zip_generated_java_files),
],
labels = ["codegen_rule"],
labels = library_labels + ["codegen_rule"],
visibility = ["PUBLIC"],
deps = [
react_native_dep("third-party/android/androidx:annotation"),
@ -458,7 +492,7 @@ def rn_codegen_components(
srcs = [
":{}".format(zip_generated_cxx_files),
],
labels = ["codegen_rule"],
labels = library_labels + ["codegen_rule"],
visibility = ["PUBLIC"],
deps = [
react_native_dep("third-party/android/androidx:annotation"),
@ -469,28 +503,6 @@ def rn_codegen_components(
],
)
# Tests
fb_xplat_cxx_test(
name = "generated_tests-{}".format(name),
srcs = [
":{}".format(generate_tests_cpp_name),
],
apple_sdks = (IOS, MACOSX),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = ["codegen_rule"],
platforms = (ANDROID, APPLE, CXX),
deps = [
"//xplat/third-party/gmock:gtest",
":generated_components-{}".format(name),
],
)
def rn_codegen_cxx_modules(
name = "",
schema_target = ""):

Просмотреть файл

@ -82,6 +82,7 @@ public class CodegenPlugin implements Plugin<Project> {
task.getInputs()
.files(project.fileTree(ImmutableMap.of("dir", extension.codegenDir())));
task.getInputs().files(extension.codegenGenerateNativeModuleSpecsCLI());
task.getInputs().files(generatedSchemaFile);
task.getOutputs().dir(generatedSrcDir);

Просмотреть файл

@ -49,6 +49,8 @@ type Options = $ReadOnly<{
}>;
type Generators =
| 'componentsAndroid'
| 'componentsIOS'
| 'descriptors'
| 'events'
| 'props'
@ -74,6 +76,24 @@ const GENERATORS = {
generatePropsJavaDelegate.generate,
],
// TODO: Refactor this to consolidate various C++ output variation instead of forking per platform.
componentsAndroid: [
// TODO: enable C++ output below:
// generateComponentDescriptorH.generate,
// generateEventEmitterCpp.generate,
// generateEventEmitterH.generate,
// generatePropsCpp.generate,
// generatePropsH.generate,
generatePropsJavaInterface.generate,
generatePropsJavaDelegate.generate,
],
componentsIOS: [
generateComponentDescriptorH.generate,
generateEventEmitterCpp.generate,
generateEventEmitterH.generate,
generateComponentHObjCpp.generate,
generatePropsCpp.generate,
generatePropsH.generate,
],
modulesAndroid: [
GenerateModuleJniCpp.generate,
GenerateModuleJniH.generate,

Просмотреть файл

@ -36,7 +36,7 @@ const template = `/**
* ${'@'}generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
package ::_PACKAGE_NAME_::;
::_IMPORTS_::
@ -268,6 +268,12 @@ module.exports = {
moduleSpecName: string,
packageName?: string,
): FilesOutput {
// TODO: This doesn't support custom package name yet.
// TODO: But it customizes the name here temporarily to prepare for Fabric RNTester support.
const normalizedPackageName =
packageName != null ? packageName : 'com.facebook.react.viewmanagers';
const outputDir = `java/${normalizedPackageName.replace(/\./g, '/')}`;
const files = new Map();
Object.keys(schema.modules).forEach(moduleName => {
const module = schema.modules[moduleName];
@ -293,7 +299,6 @@ module.exports = {
const component = components[componentName];
const className = getDelegateJavaClassName(componentName);
const interfaceClassName = getInterfaceJavaClassName(componentName);
const fileName = `${className}.java`;
const imports = getDelegateImports(component);
const propsString = generatePropCasesString(component, componentName);
@ -310,6 +315,7 @@ module.exports = {
.sort()
.join('\n'),
)
.replace(/::_PACKAGE_NAME_::/g, normalizedPackageName)
.replace(/::_CLASSNAME_::/g, className)
.replace('::_EXTEND_CLASSES_::', extendString)
.replace('::_PROP_CASES_::', propsString)
@ -319,7 +325,7 @@ module.exports = {
)
.replace(/::_INTERFACE_CLASSNAME_::/g, interfaceClassName);
files.set(fileName, replacedTemplate);
files.set(`${outputDir}/${className}.java`, replacedTemplate);
});
});

Просмотреть файл

@ -35,7 +35,7 @@ const template = `/**
* ${'@'}generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
package ::_PACKAGE_NAME_::;
::_IMPORTS_::
@ -215,6 +215,12 @@ module.exports = {
moduleSpecName: string,
packageName?: string,
): FilesOutput {
// TODO: This doesn't support custom package name yet.
// TODO: But it customizes the name here temporarily to prepare for Fabric RNTester support.
const normalizedPackageName =
packageName != null ? packageName : 'com.facebook.react.viewmanagers';
const outputDir = `java/${normalizedPackageName.replace(/\./g, '/')}`;
const files = new Map();
Object.keys(schema.modules).forEach(moduleName => {
const module = schema.modules[moduleName];
@ -240,7 +246,6 @@ module.exports = {
.forEach(componentName => {
const component = components[componentName];
const className = getInterfaceJavaClassName(componentName);
const fileName = `${className}.java`;
const imports = getImports(component, 'interface');
const propsString = generatePropsString(component, imports);
@ -257,6 +262,7 @@ module.exports = {
.sort()
.join('\n'),
)
.replace(/::_PACKAGE_NAME_::/g, normalizedPackageName)
.replace(/::_CLASSNAME_::/g, className)
.replace('::_EXTEND_CLASSES_::', extendString)
.replace(
@ -265,7 +271,7 @@ module.exports = {
)
.replace('::_COMMAND_HANDLERS_::', commandsString);
files.set(fileName, replacedTemplate);
files.set(`${outputDir}/${className}.java`, replacedTemplate);
});
});

Просмотреть файл

@ -2,7 +2,7 @@
exports[`GeneratePropsJavaDelegate can generate fixture ARRAY_PROPS 1`] = `
Map {
"ArrayPropsNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -71,7 +71,7 @@ public class ArrayPropsNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture ARRAY_PROPS_WITH_NESTED_OBJECT 1`] = `
Map {
"ArrayPropsNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -110,7 +110,7 @@ public class ArrayPropsNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture BOOLEAN_PROP 1`] = `
Map {
"BooleanPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -148,7 +148,7 @@ public class BooleanPropNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture COLOR_PROP 1`] = `
Map {
"ColorPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -187,7 +187,7 @@ public class ColorPropNativeComponentManagerDelegate<T extends View, U extends B
exports[`GeneratePropsJavaDelegate can generate fixture COMMANDS 1`] = `
Map {
"CommandNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -232,7 +232,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
exports[`GeneratePropsJavaDelegate can generate fixture COMMANDS_AND_PROPS 1`] = `
Map {
"CommandNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -283,7 +283,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
exports[`GeneratePropsJavaDelegate can generate fixture DOUBLE_PROPS 1`] = `
Map {
"DoublePropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/DoublePropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -336,7 +336,7 @@ public class DoublePropNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
Map {
"EventsNestedObjectNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/EventsNestedObjectNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -374,7 +374,7 @@ public class EventsNestedObjectNativeComponentManagerDelegate<T extends View, U
exports[`GeneratePropsJavaDelegate can generate fixture EVENT_PROPS 1`] = `
Map {
"EventsNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/EventsNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -412,7 +412,7 @@ public class EventsNativeComponentManagerDelegate<T extends View, U extends Base
exports[`GeneratePropsJavaDelegate can generate fixture EVENTS_WITH_PAPER_NAME 1`] = `
Map {
"InterfaceOnlyComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -448,7 +448,7 @@ exports[`GeneratePropsJavaDelegate can generate fixture EXCLUDE_ANDROID_IOS 1`]
exports[`GeneratePropsJavaDelegate can generate fixture FLOAT_PROPS 1`] = `
Map {
"FloatPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/FloatPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -501,7 +501,7 @@ public class FloatPropNativeComponentManagerDelegate<T extends View, U extends B
exports[`GeneratePropsJavaDelegate can generate fixture IMAGE_PROP 1`] = `
Map {
"ImagePropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -540,7 +540,7 @@ public class ImagePropNativeComponentManagerDelegate<T extends View, U extends B
exports[`GeneratePropsJavaDelegate can generate fixture INSETS_PROP 1`] = `
Map {
"InsetsPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/InsetsPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -579,7 +579,7 @@ public class InsetsPropNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture INT32_ENUM_PROP 1`] = `
Map {
"Int32EnumPropsNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/Int32EnumPropsNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -617,7 +617,7 @@ public class Int32EnumPropsNativeComponentManagerDelegate<T extends View, U exte
exports[`GeneratePropsJavaDelegate can generate fixture INTEGER_PROPS 1`] = `
Map {
"IntegerPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -661,7 +661,7 @@ public class IntegerPropNativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture INTERFACE_ONLY 1`] = `
Map {
"InterfaceOnlyComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -699,7 +699,7 @@ public class InterfaceOnlyComponentManagerDelegate<T extends View, U extends Bas
exports[`GeneratePropsJavaDelegate can generate fixture MULTI_NATIVE_PROP 1`] = `
Map {
"ImageColorPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ImageColorPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -748,7 +748,7 @@ public class ImageColorPropNativeComponentManagerDelegate<T extends View, U exte
exports[`GeneratePropsJavaDelegate can generate fixture NO_PROPS_NO_EVENTS 1`] = `
Map {
"NoPropsNoEventsComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/NoPropsNoEventsComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -780,7 +780,7 @@ public class NoPropsNoEventsComponentManagerDelegate<T extends View, U extends B
exports[`GeneratePropsJavaDelegate can generate fixture OBJECT_PROPS 1`] = `
Map {
"ObjectPropsManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/ObjectPropsManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -819,7 +819,7 @@ public class ObjectPropsManagerDelegate<T extends View, U extends BaseViewManage
exports[`GeneratePropsJavaDelegate can generate fixture POINT_PROP 1`] = `
Map {
"PointPropNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/PointPropNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -858,7 +858,7 @@ public class PointPropNativeComponentManagerDelegate<T extends View, U extends B
exports[`GeneratePropsJavaDelegate can generate fixture STRING_ENUM_PROP 1`] = `
Map {
"StringEnumPropsNativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/StringEnumPropsNativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -896,7 +896,7 @@ public class StringEnumPropsNativeComponentManagerDelegate<T extends View, U ext
exports[`GeneratePropsJavaDelegate can generate fixture STRING_PROP 1`] = `
Map {
"StringPropComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/StringPropComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -937,7 +937,7 @@ public class StringPropComponentManagerDelegate<T extends View, U extends BaseVi
exports[`GeneratePropsJavaDelegate can generate fixture TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
Map {
"MultiFile1NativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/MultiFile1NativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -970,7 +970,7 @@ public class MultiFile1NativeComponentManagerDelegate<T extends View, U extends
}
}
",
"MultiFile2NativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/MultiFile2NativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -1008,7 +1008,7 @@ public class MultiFile2NativeComponentManagerDelegate<T extends View, U extends
exports[`GeneratePropsJavaDelegate can generate fixture TWO_COMPONENTS_SAME_FILE 1`] = `
Map {
"MultiComponent1NativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent1NativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -1041,7 +1041,7 @@ public class MultiComponent1NativeComponentManagerDelegate<T extends View, U ext
}
}
",
"MultiComponent2NativeComponentManagerDelegate.java" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent2NativeComponentManagerDelegate.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the

Просмотреть файл

@ -2,7 +2,7 @@
exports[`GeneratePropsJavaInterface can generate fixture ARRAY_PROPS 1`] = `
Map {
"ArrayPropsNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -36,7 +36,7 @@ public interface ArrayPropsNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture ARRAY_PROPS_WITH_NESTED_OBJECT 1`] = `
Map {
"ArrayPropsNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -60,7 +60,7 @@ public interface ArrayPropsNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture BOOLEAN_PROP 1`] = `
Map {
"BooleanPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -82,7 +82,7 @@ public interface BooleanPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture COLOR_PROP 1`] = `
Map {
"ColorPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -105,7 +105,7 @@ public interface ColorPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture COMMANDS 1`] = `
Map {
"CommandNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -129,7 +129,7 @@ public interface CommandNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture COMMANDS_AND_PROPS 1`] = `
Map {
"CommandNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -154,7 +154,7 @@ public interface CommandNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture DOUBLE_PROPS 1`] = `
Map {
"DoublePropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/DoublePropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -181,7 +181,7 @@ public interface DoublePropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
Map {
"EventsNestedObjectNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/EventsNestedObjectNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -203,7 +203,7 @@ public interface EventsNestedObjectNativeComponentManagerInterface<T extends Vie
exports[`GeneratePropsJavaInterface can generate fixture EVENT_PROPS 1`] = `
Map {
"EventsNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/EventsNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -225,7 +225,7 @@ public interface EventsNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture EVENTS_WITH_PAPER_NAME 1`] = `
Map {
"InterfaceOnlyComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -251,7 +251,7 @@ exports[`GeneratePropsJavaInterface can generate fixture EXCLUDE_ANDROID_IOS 1`]
exports[`GeneratePropsJavaInterface can generate fixture FLOAT_PROPS 1`] = `
Map {
"FloatPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/FloatPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -278,7 +278,7 @@ public interface FloatPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture IMAGE_PROP 1`] = `
Map {
"ImagePropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -302,7 +302,7 @@ public interface ImagePropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture INSETS_PROP 1`] = `
Map {
"InsetsPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/InsetsPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -326,7 +326,7 @@ public interface InsetsPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture INT32_ENUM_PROP 1`] = `
Map {
"Int32EnumPropsNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/Int32EnumPropsNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -349,7 +349,7 @@ public interface Int32EnumPropsNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture INTEGER_PROPS 1`] = `
Map {
"IntegerPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -373,7 +373,7 @@ public interface IntegerPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture INTERFACE_ONLY 1`] = `
Map {
"InterfaceOnlyComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -396,7 +396,7 @@ public interface InterfaceOnlyComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture MULTI_NATIVE_PROP 1`] = `
Map {
"ImageColorPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ImageColorPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -423,7 +423,7 @@ public interface ImageColorPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture NO_PROPS_NO_EVENTS 1`] = `
Map {
"NoPropsNoEventsComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/NoPropsNoEventsComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -445,7 +445,7 @@ public interface NoPropsNoEventsComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture OBJECT_PROPS 1`] = `
Map {
"ObjectPropsManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/ObjectPropsManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -469,7 +469,7 @@ public interface ObjectPropsManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture POINT_PROP 1`] = `
Map {
"PointPropNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/PointPropNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -493,7 +493,7 @@ public interface PointPropNativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture STRING_ENUM_PROP 1`] = `
Map {
"StringEnumPropsNativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/StringEnumPropsNativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -516,7 +516,7 @@ public interface StringEnumPropsNativeComponentManagerInterface<T extends View>
exports[`GeneratePropsJavaInterface can generate fixture STRING_PROP 1`] = `
Map {
"StringPropComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/StringPropComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -540,7 +540,7 @@ public interface StringPropComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
Map {
"MultiFile1NativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/MultiFile1NativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -557,7 +557,7 @@ public interface MultiFile1NativeComponentManagerInterface<T extends View> {
void setDisabled(T view, boolean value);
}
",
"MultiFile2NativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/MultiFile2NativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -579,7 +579,7 @@ public interface MultiFile2NativeComponentManagerInterface<T extends View> {
exports[`GeneratePropsJavaInterface can generate fixture TWO_COMPONENTS_SAME_FILE 1`] = `
Map {
"MultiComponent1NativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent1NativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
@ -596,7 +596,7 @@ public interface MultiComponent1NativeComponentManagerInterface<T extends View>
void setDisabled(T view, boolean value);
}
",
"MultiComponent2NativeComponentManagerInterface.java" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent2NativeComponentManagerInterface.java" => "/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the

Просмотреть файл

@ -23,8 +23,12 @@ const fs = require('fs');
const mkdirp = require('mkdirp');
const path = require('path');
const USE_FABRIC = process.env.USE_FABRIC != null && !!process.env.USE_FABRIC;
const GENERATORS = {
android: ['modulesAndroid'],
android: USE_FABRIC
? ['componentsAndroid', 'modulesAndroid']
: ['modulesAndroid'],
ios: ['modulesIOS'],
};