Update iOS Fabric-related files to compile on OSS (#29810)

Summary:
Original PR contents:

This pull request updates the Podspecs and associated build scripts, and some source files so they build on OSS. RNTester now compiles with `fabric_enabled` again.

The following changes have been made:

 * Various spots that were pointing to the old `ReactCommon/fabric` location have now been updated to `ReactCommon/react/renderer`
 * Files that were attempting to use internal FB header `FBRCTFabricComponentsPlugins.h` were changed to use `RCTFabricComponentsPlugins.h`
 * `RCTFabricComponentsPlugins` in OSS was updated to include the `Image` fabric component (thanks tsapeta)
 * Replaced old `generate-rncore.sh` build script with new `generate-rncore.js` script which does not require `flow-node` and uses the `react-native-codegen` API directly, so there is no longer any need for an interim `schema-rncore.json` file.
 * Updated Yoga podspec which wasn't fully synced with changes from the main Yoga repo
 * Updated Fabric podspec with additional needed subspecs

Additions to PR by hramos:
* Replaced use of generate-rncore scripts with the original generate-native-modules-specs.sh script, which is now generate-specs.sh and supports both codegen for Native Modules and Components now (TurboModules/Fabric).
* Codegen now runs at build time as part of the Xcode build pipeline instead of as part of `pod install`. The build script is injected by the FBReactNativeSpec pod, as the pod is part of both Fabric and non-Fabric builds.

## Changelog

[General] [Fixed] - RNTester compiles with `fabric_enabled` again

Pull Request resolved: https://github.com/facebook/react-native/pull/29810

Test Plan:
RNTester now compiles and runs in the simulator again when `fabric_enabled` is set to `true`.

```
cd xplat/js/react-native-github/packages/rn-tester
USE_FABRIC=1 pod install
open RNTesterPods.xcworkspace
# Build and run
```

Reviewed By: fkgozali

Differential Revision: D24058507

Pulled By: hramos

fbshipit-source-id: 8b2ea3694e6cb9aa23f83f087e2995fd4320e2bb
This commit is contained in:
empyrical 2020-12-22 08:33:56 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 86ffbd0a27
Коммит f312e5ba84
23 изменённых файлов: 209 добавлений и 150 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -102,8 +102,7 @@ package-lock.json
# react-native-codegen # react-native-codegen
/Libraries/FBReactNativeSpec/FBReactNativeSpec /Libraries/FBReactNativeSpec/FBReactNativeSpec
/packages/react-native-codegen/lib /packages/react-native-codegen/lib
/ReactCommon/fabric/components/rncore/ /ReactCommon/react/renderer/components/rncore/
/schema-rncore.json
# Visual studio # Visual studio
.vscode .vscode

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

@ -20,11 +20,27 @@ end
react_native_path = File.join(__dir__, "..", "..") react_native_path = File.join(__dir__, "..", "..")
srcs_dir = File.join(__dir__, "..") srcs_dir = File.join(__dir__, "..")
codegen_script_path = File.join(react_native_path, "scripts", "generate-native-modules-specs.sh") codegen_script_path = File.join(react_native_path, "scripts", "generate-specs.sh")
codegen_path = File.join(react_native_path, codegen_path_prefix, "react-native-codegen") codegen_path = File.join(react_native_path, codegen_path_prefix, "react-native-codegen")
output_dir = File.join(__dir__, "FBReactNativeSpec")
generated_files = [File.join(output_dir, "FBReactNativeSpec.h"), File.join(output_dir, "FBReactNativeSpec-generated.mm")]
codegen_command = "CODEGEN_PATH=#{codegen_path} sh '#{codegen_script_path}' | tee \"${SCRIPT_OUTPUT_FILE_0}\"" codegen_command = "CODEGEN_PATH=#{codegen_path} sh '#{codegen_script_path}' | tee \"${SCRIPT_OUTPUT_FILE_0}\""
modules_output_dir = File.join(__dir__, "FBReactNativeSpec")
components_output_dir = File.join(react_native_path, "ReactCommon", "react", "renderer", "components", "rncore")
generated_filenames = [ "FBReactNativeSpec.h", "FBReactNativeSpec-generated.mm" ]
generated_files = generated_filenames.map { |filename| File.join(modules_output_dir, filename) }
if ENV['USE_FABRIC'] == '1'
components_generated_filenames = [
"ComponentDescriptors.h",
"EventEmitters.cpp",
"EventEmitters.h",
"Props.cpp",
"Props.h",
"RCTComponentViewHelpers.h",
"ShadowNodes.cpp",
"ShadowNodes.h"
]
generated_files = generated_files.concat(components_generated_filenames.map { |filename| File.join(components_output_dir, filename) })
end
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2020.01.13.00' folly_version = '2020.01.13.00'
@ -40,6 +56,7 @@ Pod::Spec.new do |s|
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source s.source = source
s.source_files = "**/*.{c,h,m,mm,cpp}" s.source_files = "**/*.{c,h,m,mm,cpp}"
s.exclude_files = "jni"
s.header_dir = "FBReactNativeSpec" s.header_dir = "FBReactNativeSpec"
s.pod_target_xcconfig = { s.pod_target_xcconfig = {
@ -55,11 +72,11 @@ Pod::Spec.new do |s|
s.dependency "React-jsi", version s.dependency "React-jsi", version
s.dependency "ReactCommon/turbomodule/core", version s.dependency "ReactCommon/turbomodule/core", version
s.prepare_command = "mkdir -p #{output_dir} && touch #{generated_files.reduce() { |str, file| str + " " + file }}" s.prepare_command = "mkdir -p #{modules_output_dir} #{components_output_dir} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
s.script_phase = { s.script_phase = {
:name => 'Generate Native Modules Code', :name => 'Generate Specs',
:input_files => [srcs_dir], :input_files => [srcs_dir],
:output_files => ["$(DERIVED_FILE_DIR)/FBReactNativeSpec-codegen.log"], :output_files => ["$(DERIVED_FILE_DIR)/codegen.log"],
:script => codegen_command, :script => codegen_command,
:execution_position => :before_compile :execution_position => :before_compile
} }

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

@ -13,7 +13,7 @@
#import <react/renderer/components/rncore/EventEmitters.h> #import <react/renderer/components/rncore/EventEmitters.h>
#import <react/renderer/components/rncore/Props.h> #import <react/renderer/components/rncore/Props.h>
#import "FBRCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -15,8 +15,8 @@
#import <react/renderer/components/iospicker/PickerProps.h> #import <react/renderer/components/iospicker/PickerProps.h>
#import <react/renderer/textlayoutmanager/RCTAttributedTextUtils.h> #import <react/renderer/textlayoutmanager/RCTAttributedTextUtils.h>
#import "FBRCTFabricComponentsPlugins.h"
#import "RCTConversions.h" #import "RCTConversions.h"
#import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -41,6 +41,7 @@ Class<RCTComponentViewProtocol> RCTParagraphCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTTextInputCls(void) __attribute__((used)); Class<RCTComponentViewProtocol> RCTTextInputCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTInputAccessoryCls(void) __attribute__((used)); Class<RCTComponentViewProtocol> RCTInputAccessoryCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTViewCls(void) __attribute__((used)); Class<RCTComponentViewProtocol> RCTViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTImageCls(void) __attribute__((used));
#ifdef __cplusplus #ifdef __cplusplus
} }

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

@ -30,6 +30,7 @@ Class<RCTComponentViewProtocol> RCTFabricComponentsProvider(const char *name) {
{"TextInput", RCTTextInputCls}, {"TextInput", RCTTextInputCls},
{"InputAccessoryView", RCTInputAccessoryCls}, {"InputAccessoryView", RCTInputAccessoryCls},
{"View", RCTViewCls}, {"View", RCTViewCls},
{"Image", RCTImageCls},
}; };
auto p = sFabricComponentsClassMap.find(name); auto p = sFabricComponentsClassMap.find(name);

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

@ -10,7 +10,6 @@
#import <React/RCTUtils.h> #import <React/RCTUtils.h>
#import <react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h> #import <react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h>
#import <react/renderer/components/safeareaview/SafeAreaViewState.h> #import <react/renderer/components/safeareaview/SafeAreaViewState.h>
#import "FBRCTFabricComponentsPlugins.h"
#import "RCTConversions.h" #import "RCTConversions.h"
#import "RCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"

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

@ -16,7 +16,7 @@
#import <React/RCTRefreshableProtocol.h> #import <React/RCTRefreshableProtocol.h>
#import <React/RCTScrollViewComponentView.h> #import <React/RCTScrollViewComponentView.h>
#import "FBRCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -15,7 +15,7 @@
#import <react/renderer/components/rncore/Props.h> #import <react/renderer/components/rncore/Props.h>
#import <react/renderer/components/slider/SliderComponentDescriptor.h> #import <react/renderer/components/slider/SliderComponentDescriptor.h>
#import "FBRCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -14,7 +14,7 @@
#import <react/renderer/components/rncore/Props.h> #import <react/renderer/components/rncore/Props.h>
#import <react/renderer/components/rncore/RCTComponentViewHelpers.h> #import <react/renderer/components/rncore/RCTComponentViewHelpers.h>
#import "FBRCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -16,7 +16,7 @@
#import <React/RCTConversions.h> #import <React/RCTConversions.h>
#import "FBRCTFabricComponentsPlugins.h" #import "RCTFabricComponentsPlugins.h"
using namespace facebook::react; using namespace facebook::react;

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

@ -30,8 +30,7 @@ Pod::Spec.new do |s|
s.author = "Facebook, Inc. and its affiliates" s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "10.0" } s.platforms = { :ios => "10.0" }
s.source = source s.source = source
s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}", s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}"
"Tests/**/*.{mm}"
s.exclude_files = "**/tests/*", s.exclude_files = "**/tests/*",
"**/android/*", "**/android/*",
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
@ -45,5 +44,10 @@ Pod::Spec.new do |s|
s.dependency "React-Core", version s.dependency "React-Core", version
s.dependency "React-Fabric", version s.dependency "React-Fabric", version
s.dependency "React-RCTImage", version s.dependency "React-RCTImage", version
s.dependency "Folly/Fabric", folly_version s.dependency "RCT-Folly/Fabric", folly_version
s.test_spec 'Tests' do |test_spec|
test_spec.source_files = "Tests/**/*.{mm}"
test_spec.framework = "XCTest"
end
end end

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

@ -18,7 +18,7 @@ end
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2020.01.13.00' folly_version = '2020.01.13.00'
folly_dep_name = 'Folly/Fabric' folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation' boost_compiler_flags = '-Wno-documentation'
Pod::Spec.new do |s| Pod::Spec.new do |s|
@ -30,7 +30,6 @@ Pod::Spec.new do |s|
s.author = "Facebook, Inc. and its affiliates" s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "10.0" } s.platforms = { :ios => "10.0" }
s.source = source s.source = source
s.prepare_command = File.read("../scripts/generate-rncore.sh")
s.source_files = "dummyFile.cpp" s.source_files = "dummyFile.cpp"
s.library = "stdc++" s.library = "stdc++"
s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
@ -44,12 +43,21 @@ Pod::Spec.new do |s|
s.dependency "ReactCommon/turbomodule/core", version s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version s.dependency "React-jsi", version
s.subspec "animations" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/animations/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/animations/tests"
ss.header_dir = "react/renderer/animations"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
s.subspec "attributedstring" do |ss| s.subspec "attributedstring" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/attributedstring/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/attributedstring/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*" ss.exclude_files = "react/renderer/attributedstring/tests"
ss.header_dir = "react/attributedstring" ss.header_dir = "react/renderer/attributedstring"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
@ -57,13 +65,13 @@ Pod::Spec.new do |s|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "better/**/*.{m,mm,cpp,h}" ss.source_files = "better/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*" ss.exclude_files = "better/tests"
ss.header_dir = "better" ss.header_dir = "better"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "config" do |ss| s.subspec "config" do |ss|
ss.source_files = "config/*.{m,mm,cpp,h}" ss.source_files = "react/config/*.{m,mm,cpp,h}"
ss.header_dir = "react/config" ss.header_dir = "react/config"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
end end
@ -71,121 +79,145 @@ Pod::Spec.new do |s|
s.subspec "core" do |ss| s.subspec "core" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
ss.source_files = "fabric/core/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/core/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/**/*" ss.exclude_files = "react/renderer/core/tests"
ss.header_dir = "react/core" ss.header_dir = "react/renderer/core"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "componentregistry" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/componentregistry/**/*.{m,mm,cpp,h}"
ss.header_dir = "react/renderer/componentregistry"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
s.subspec "components" do |ss| s.subspec "components" do |ss|
ss.subspec "activityindicator" do |sss| ss.subspec "activityindicator" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/activityindicator/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/activityindicator/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/activityindicator/tests"
sss.header_dir = "react/components/activityindicator" sss.header_dir = "react/renderer/components/activityindicator"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "image" do |sss| ss.subspec "image" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/image/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/image/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/image/tests"
sss.header_dir = "react/components/image" sss.header_dir = "react/renderer/components/image"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
ss.subspec "inputaccessory" do |sss|
sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags
sss.source_files = "react/renderer/components/inputaccessory/**/*.{m,mm,cpp,h}"
sss.exclude_files = "react/renderer/components/inputaccessory/tests"
sss.header_dir = "react/renderer/components/inputaccessory"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "legacyviewmanagerinterop" do |sss| ss.subspec "legacyviewmanagerinterop" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/legacyviewmanagerinterop/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/legacyviewmanagerinterop/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/legacyviewmanagerinterop/tests"
sss.header_dir = "react/components/legacyviewmanagerinterop" sss.header_dir = "react/renderer/components/legacyviewmanagerinterop"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\"" }
end end
ss.subspec "modal" do |sss| ss.subspec "modal" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/modal/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/modal/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/modal/tests"
sss.header_dir = "react/components/modal" sss.header_dir = "react/renderer/components/modal"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
ss.subspec "picker" do |sss|
sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags
sss.source_files = "react/renderer/components/picker/iospicker/**/*.{m,mm,cpp,h}"
sss.exclude_files = "react/renderer/components/picker/iospicker/tests"
sss.header_dir = "react/renderer/components/iospicker"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "rncore" do |sss| ss.subspec "rncore" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/rncore/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/rncore/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*", "fabric/components/rncore/*Tests.{h,cpp}", sss.exclude_files = "react/renderer/components/rncore/tests"
# TODO: These should be re-enabled later when Codegen Native Module support is needed. sss.header_dir = "react/renderer/components/rncore"
"fabric/components/rncore/rncore-generated.mm", "fabric/components/rncore/NativeModules.{h,cpp}"
sss.header_dir = "react/components/rncore"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "root" do |sss| ss.subspec "root" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/root/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/root/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/root/tests"
sss.header_dir = "react/components/root" sss.header_dir = "react/renderer/components/root"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "safeareaview" do |sss| ss.subspec "safeareaview" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/safeareaview/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/safeareaview/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/safeareaview/tests"
sss.header_dir = "react/components/safeareaview" sss.header_dir = "react/renderer/components/safeareaview"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "scrollview" do |sss| ss.subspec "scrollview" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/scrollview/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/scrollview/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/scrollview/tests"
sss.header_dir = "react/components/scrollview" sss.header_dir = "react/renderer/components/scrollview"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "slider" do |sss| ss.subspec "slider" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/slider/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/slider/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*", sss.exclude_files = "react/renderer/components/slider/tests/**/*",
"**/android/*" "react/renderer/components/slider/platform/android"
sss.header_dir = "react/components/slider" sss.header_dir = "react/renderer/components/slider"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "text" do |sss| ss.subspec "text" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/text/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/text/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/text/tests"
sss.header_dir = "react/components/text" sss.header_dir = "react/renderer/components/text"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "textinput" do |sss| ss.subspec "textinput" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/textinput/iostextinput/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/textinput/iostextinput/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/textinput/iostextinput/tests"
sss.header_dir = "react/components/iostextinput" sss.header_dir = "react/renderer/components/iostextinput"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
ss.subspec "unimplementedview" do |sss| ss.subspec "unimplementedview" do |sss|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/unimplementedview/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/unimplementedview/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/unimplementedview/tests"
sss.header_dir = "react/components/unimplementedview" sss.header_dir = "react/renderer/components/unimplementedview"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
@ -193,9 +225,9 @@ Pod::Spec.new do |s|
sss.dependency folly_dep_name, folly_version sss.dependency folly_dep_name, folly_version
sss.dependency "Yoga" sss.dependency "Yoga"
sss.compiler_flags = folly_compiler_flags sss.compiler_flags = folly_compiler_flags
sss.source_files = "fabric/components/view/**/*.{m,mm,cpp,h}" sss.source_files = "react/renderer/components/view/**/*.{m,mm,cpp,h}"
sss.exclude_files = "**/tests/*" sss.exclude_files = "react/renderer/components/view/tests"
sss.header_dir = "react/components/view" sss.header_dir = "react/renderer/components/view"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
end end
@ -203,9 +235,9 @@ Pod::Spec.new do |s|
s.subspec "debug" do |ss| s.subspec "debug" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/debug/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/debug/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*" ss.exclude_files = "react/renderer/debug/tests"
ss.header_dir = "react/debug" ss.header_dir = "react/renderer/debug"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
@ -213,45 +245,64 @@ Pod::Spec.new do |s|
ss.dependency "React-RCTImage", version ss.dependency "React-RCTImage", version
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/imagemanager/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/imagemanager/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*", ss.exclude_files = "react/renderer/imagemanager/tests",
"**/android/*", "react/renderer/imagemanager/platform/android",
"**/cxx/*" "react/renderer/imagemanager/platform/cxx"
ss.header_dir = "react/imagemanager" ss.header_dir = "react/renderer/imagemanager"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "mounting" do |ss| s.subspec "mounting" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/mounting/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/mounting/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*" ss.exclude_files = "react/renderer/mounting/tests"
ss.header_dir = "react/mounting" ss.header_dir = "react/renderer/mounting"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
s.subspec "scheduler" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/scheduler/**/*.{m,mm,cpp,h}"
ss.header_dir = "react/renderer/scheduler"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end
s.subspec "templateprocessor" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/templateprocessor/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/templateprocessor/tests"
ss.header_dir = "react/renderer/templateprocessor"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "textlayoutmanager" do |ss| s.subspec "textlayoutmanager" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.dependency "React-Fabric/uimanager"
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/textlayoutmanager/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/textlayoutmanager/platform/ios/**/*.{m,mm,cpp,h}",
ss.exclude_files = "**/tests/*", "react/renderer/textlayoutmanager/*.{m,mm,cpp,h}"
"**/android/*", ss.exclude_files = "react/renderer/textlayoutmanager/tests",
"**/cxx/*" "react/renderer/textlayoutmanager/platform/android",
ss.header_dir = "react/textlayoutmanager" "react/renderer/textlayoutmanager/platform/cxx"
ss.header_dir = "react/renderer/textlayoutmanager"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "uimanager" do |ss| s.subspec "uimanager" do |ss|
ss.dependency folly_dep_name, folly_version ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags ss.compiler_flags = folly_compiler_flags
ss.source_files = "fabric/uimanager/**/*.{m,mm,cpp,h}" ss.source_files = "react/renderer/uimanager/**/*.{m,mm,cpp,h}"
ss.exclude_files = "**/tests/*", ss.exclude_files = "react/renderer/uimanager/tests"
ss.header_dir = "react/uimanager" ss.header_dir = "react/renderer/uimanager"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end
s.subspec "utils" do |ss| s.subspec "utils" do |ss|
ss.source_files = "utils/*.{m,mm,cpp,h}" ss.source_files = "react/utils/*.{m,mm,cpp,h}"
ss.header_dir = "react/utils" ss.header_dir = "react/utils"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
end end

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

@ -5,7 +5,7 @@
require "json" require "json"
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
version = package['version'] version = package['version']
source = { :git => 'https://github.com/facebook/react-native.git' } source = { :git => 'https://github.com/facebook/react-native.git' }
@ -32,11 +32,11 @@ Pod::Spec.new do |s|
s.library = "stdc++" s.library = "stdc++"
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.source_files = "**/*.{m,mm,cpp,h}" s.source_files = "**/*.{m,mm,cpp,h}"
s.exclude_files = "**/tests/*", s.exclude_files = "tests",
"**/android/*", "platform/android",
"**/cxx/*" "platform/cxx"
s.header_dir = "react/graphics" s.header_dir = "react/renderer/graphics"
s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/../../../\" \"$(PODS_ROOT)/RCT-Folly\"" }
s.dependency "Folly/Fabric", folly_version s.dependency "RCT-Folly/Fabric", folly_version
end end

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

@ -51,7 +51,7 @@ Pod::Spec.new do |spec|
source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
spec.source_files = source_files spec.source_files = source_files
header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h' header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h'
header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
spec.public_header_files = header_files spec.public_header_files = header_files
end end

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

@ -38,8 +38,8 @@
"README.md", "README.md",
"rn-get-polyfills.js", "rn-get-polyfills.js",
"scripts/compose-source-maps.js", "scripts/compose-source-maps.js",
"scripts/generate-native-modules-specs.sh", "scripts/generate-specs.sh",
"scripts/generate-native-modules-specs-cli.js", "scripts/generate-specs-cli.js",
"scripts/ios-configure-glog.sh", "scripts/ios-configure-glog.sh",
"scripts/launchPackager.bat", "scripts/launchPackager.bat",
"scripts/launchPackager.command", "scripts/launchPackager.command",

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

@ -34,7 +34,7 @@ public class CodegenPluginExtension {
} }
public File codegenGenerateNativeModuleSpecsCLI() { public File codegenGenerateNativeModuleSpecsCLI() {
return new File(this.reactNativeRootDir, "scripts/generate-native-modules-specs-cli.js"); return new File(this.reactNativeRootDir, "scripts/generate-specs-cli.js");
} }
private String projectPathToLibraryName(final String projectPath) { private String projectPathToLibraryName(final String projectPath) {

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

@ -17,18 +17,26 @@ end
def pods() def pods()
project 'RNTesterPods.xcodeproj' project 'RNTesterPods.xcodeproj'
# Enable TurboModule fabric_enabled = false
# To use fabric: set the environment variable `USE_FABRIC` to 1, like below
# $ USE_FABRIC=1 bundle exec pod install
# or
# $ export USE_FABRIC=1
# $ bundle exec pod install
if ENV['USE_FABRIC'] == '1'
puts "Building RNTester with Fabric enabled."
fabric_enabled = true
end
prefix_path = "../.." prefix_path = "../.."
use_react_native!(path: prefix_path, hermes_enabled: ENV['USE_HERMES'] == '1') use_react_native!(path: prefix_path, fabric_enabled: fabric_enabled, hermes_enabled: ENV['USE_HERMES'] == '1')
pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon"
# Additional Pods which aren't included in the default Podfile # Additional Pods which aren't included in the default Podfile
pod 'React-RCTPushNotification', :path => "#{prefix_path}/Libraries/PushNotificationIOS" pod 'React-RCTPushNotification', :path => "#{prefix_path}/Libraries/PushNotificationIOS"
pod 'Yoga', :path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true pod 'Yoga', :path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true
# Additional Pods which are classed as unstable # Additional Pods which are classed as unstable
#
# To use fabric: add `fabric_enabled` option to the use_react_native method above, like below
# use_react_native!(path: "..", fabric_enabled: true)
end end
target 'RNTester' do target 'RNTester' do

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

@ -490,7 +490,7 @@ SPEC CHECKSUMS:
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: cde416483dac037923206447da6e1454df403714 DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: fe973c09b2299b5e8154186ecf1f6554b4f70987 FBLazyVector: fe973c09b2299b5e8154186ecf1f6554b4f70987
FBReactNativeSpec: 765701e4018375c2e423d955806400a39bdb9c63 FBReactNativeSpec: 8e8b4f540947580f2a9ef54a443453c562d439cd
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: e4493b013c02d9347d5e0cb4d128680239f6c78a Flipper-Folly: e4493b013c02d9347d5e0cb4d128680239f6c78a
@ -525,9 +525,9 @@ SPEC CHECKSUMS:
React-RCTVibration: a1cce36dd452eb88296d99d80d66f2c5bd50aad4 React-RCTVibration: a1cce36dd452eb88296d99d80d66f2c5bd50aad4
React-runtimeexecutor: 53867815d0a01e53a2c901cb7f01076216c5c799 React-runtimeexecutor: 53867815d0a01e53a2c901cb7f01076216c5c799
ReactCommon: d101410fc55088c91dc24595715c7b26ec760adf ReactCommon: d101410fc55088c91dc24595715c7b26ec760adf
Yoga: 69ef0b2bba5387523f793957a9f80dbd61e89631 Yoga: e37ade282f73232191786671781d052c84d0faa8
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: a36cc754d464f1cc28efaac3a4065fd58419f79d PODFILE CHECKSUM: 486f12ff39a0c690fe414d7ffbbdaa371d51590b
COCOAPODS: 1.10.0 COCOAPODS: 1.10.0

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

@ -1,14 +0,0 @@
#!/bin/bash
# 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.
# This script collects the "core" component schemas used by fabric
# then uses react-native-codegen to generate the component headers
# to a location that the podspecs expect.
# shellcheck disable=SC2038
find "$PWD/../Libraries" -name "*NativeComponent.js" -print | xargs yarn flow-node packages/react-native-codegen/src/cli/combine/combine-js-to-schema-cli.js schema-rncore.json
yarn flow-node packages/react-native-codegen/buck_tests/generate-tests.js schema-rncore.json rncore ReactCommon/fabric/components/rncore rncore

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

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

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

@ -5,18 +5,18 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
# This script collects the JavaScript spec definitions for core # This script collects the JavaScript spec definitions for core
# native modules, then uses react-native-codegen to generate # native modules and components, then uses react-native-codegen
# native code. # to generate native code.
# The script will use the local react-native-codegen package by # The script will use the local react-native-codegen package by
# default. Optionally, set the CODEGEN_PATH to point to the # default. Optionally, set the CODEGEN_PATH to point to the
# desired codegen library (e.g. when using react-native-codegen # desired codegen library (e.g. when using react-native-codegen
# from npm). # from npm).
# #
# Usage: # Usage:
# ./scripts/generate-native-modules-specs.sh # ./scripts/generate-specs.sh
# #
# Example: # Examples:
# CODEGEN_PATH=.. ./scripts/generate-native-modules-specs.sh # CODEGEN_PATH=.. ./scripts/generate-specs.sh
# shellcheck disable=SC2038 # shellcheck disable=SC2038
@ -27,6 +27,7 @@ TEMP_DIR=$(mktemp -d /tmp/react-native-codegen-XXXXXXXX)
RN_DIR=$(cd "$THIS_DIR/.." && pwd) RN_DIR=$(cd "$THIS_DIR/.." && pwd)
CODEGEN_PATH="${CODEGEN_PATH:-$(cd "$RN_DIR/packages/react-native-codegen" && pwd)}" CODEGEN_PATH="${CODEGEN_PATH:-$(cd "$RN_DIR/packages/react-native-codegen" && pwd)}"
YARN_BINARY="${YARN_BINARY:-$(command -v yarn)}" YARN_BINARY="${YARN_BINARY:-$(command -v yarn)}"
USE_FABRIC="${USE_FABRIC:-0}"
cleanup () { cleanup () {
set +e set +e
@ -38,12 +39,14 @@ describe () {
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1" printf "\\n\\n>>>>> %s\\n\\n\\n" "$1"
} }
run_codegen () { main() {
SRCS_DIR=$1 SRCS_DIR=$(cd "$RN_DIR/Libraries" && pwd)
LIBRARY_NAME=$2
OUTPUT_DIR=$3
SCHEMA_FILE="$TEMP_DIR/schema-$LIBRARY_NAME.json" OUTPUT_DIR="$TEMP_DIR/out"
COMPONENTS_DIR="$RN_DIR/ReactCommon/react/renderer/components/rncore"
MODULES_DIR="$RN_DIR/Libraries/FBReactNativeSpec/FBReactNativeSpec"
SCHEMA_FILE="$TEMP_DIR/schema.json"
if [ ! -d "$CODEGEN_PATH/lib" ]; then if [ ! -d "$CODEGEN_PATH/lib" ]; then
describe "Building react-native-codegen package" describe "Building react-native-codegen package"
@ -58,21 +61,13 @@ run_codegen () {
describe "Generating native code from schema (iOS)" describe "Generating native code from schema (iOS)"
pushd "$RN_DIR" >/dev/null || exit pushd "$RN_DIR" >/dev/null || exit
"$YARN_BINARY" --silent node scripts/generate-native-modules-specs-cli.js ios "$SCHEMA_FILE" "$OUTPUT_DIR" USE_FABRIC="$USE_FABRIC" "$YARN_BINARY" --silent node scripts/generate-specs-cli.js ios "$SCHEMA_FILE" "$OUTPUT_DIR"
popd >/dev/null || exit popd >/dev/null || exit
}
# Handle Core Modules mkdir -p "$COMPONENTS_DIR" "$MODULES_DIR"
run_codegen_core_modules () { mv "$OUTPUT_DIR/FBReactNativeSpec.h" "$OUTPUT_DIR/FBReactNativeSpec-generated.mm" "$MODULES_DIR"
LIBRARY_NAME="FBReactNativeSpec" find "$OUTPUT_DIR" -type f | xargs sed -i '' 's/FBReactNativeSpec/rncore/g'
SRCS_DIR=$(cd "$RN_DIR/Libraries" && pwd) cp -R "$OUTPUT_DIR/." "$COMPONENTS_DIR"
OUTPUT_DIR="$SRCS_DIR/$LIBRARY_NAME/$LIBRARY_NAME"
run_codegen "$SRCS_DIR" "$LIBRARY_NAME" "$OUTPUT_DIR"
}
main() {
run_codegen_core_modules
} }
trap cleanup EXIT trap cleanup EXIT

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

@ -55,7 +55,7 @@ def use_react_native! (options={})
if fabric_enabled if fabric_enabled
pod 'React-Fabric', :path => "#{prefix}/ReactCommon" pod 'React-Fabric', :path => "#{prefix}/ReactCommon"
pod 'React-graphics', :path => "#{prefix}/ReactCommon/fabric/graphics" pod 'React-graphics', :path => "#{prefix}/ReactCommon/react/renderer/graphics"
pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi" pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi"
pod 'React-RCTFabric', :path => "#{prefix}/React" pod 'React-RCTFabric', :path => "#{prefix}/React"
pod 'RCT-Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec" pod 'RCT-Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec"