mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
eb2a561ecb
Summary: ## Motivation This rename will fix the following CircleCI build failures: - [test_ios_unit_frameworks](https://circleci.com/gh/facebook/react-native/150473?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link) - [test_ios_detox_frameworks](https://circleci.com/gh/facebook/react-native/150474?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link) ## Investigation We have 4 podspec targets that map to the same header namespace (i.e: `header_dir`) `ReactCommon`: - **New:** `React-perflogger`: Directory is `ReactCommon/preflogger`, and contains `NativeModulePerfLogger.{h,cpp}`. - `React-runtimeexecutor`: Directory is `ReactCommon/runtimeexecutor`, and contains only `RuntimeExecutor.h` - `React-callinvoker`: Directory is `ReactCommon/callinvoker`, and contains only `CallInvoker.h` - `ReactCommon/turbomodule/core`: Directory is `ReactCommon/turbomodule`, and contains C++ files, as well has header files. **The problem:** We couldn't import headers from `React-perflogger` in `ReactCommon/turbomodule/core` files. **The cause:** I'm not entirely sure why, but I was able to discern the following two rules by playing around with the podspecs: 1. If your podspec target has a cpp file, it'll generate a framework when `USE_FRAMEWORKS=1`. 2. Two different frameworks cannot map to the same `module_name` or `header_dir`. (Why? No clue. But something breaks silently when this is the case). So, this is what happened when I landed `React-perflogger` (D21443610): 1. The TurboModules code generates the `ReactCommon` framework that uses the `ReactCommon` header namespace. 2. `React-runtimeexecutor` and `React-callinvoker` also used the `ReactCommon` header namespace. However, neither generate a framework because of Rule 1. 3. When I comitted `React-perflogger`, I introduced a second framework that competed with the `ReactCommon` framework (i.e: TurboModules code) for the `ReactCommon` header namespace. Rule 2 violation. ## Thoughts on renaming - `<perflogger/NativeModulePerfLogger.h>` is too generic, and the `perflogger` namepsace is used internally within FB. - `<react/perflogger/NativeModulePerfLogger.h>` matches our fabric header format, but I'm pretty sure that slashes aren't allowed in `header_dir`: I tested this and it didn't work. IIRC, only alphanumeric and underscore are valid characters for `header_dir` or `module_name`. So, I opted to just use `reactperflogger`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D21598852 fbshipit-source-id: 60da5d0f7758eaf13907a080b7d8756688f40723
102 lines
5.1 KiB
Ruby
102 lines
5.1 KiB
Ruby
# 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.
|
|
|
|
def use_react_native! (options={})
|
|
# The prefix to the react-native
|
|
prefix = options[:path] ||= "../node_modules/react-native"
|
|
|
|
# Include Fabric dependencies
|
|
fabric_enabled = options[:fabric_enabled] ||= false
|
|
|
|
# Include DevSupport dependency
|
|
production = options[:production] ||= false
|
|
|
|
# The Pods which should be included in all projects
|
|
pod 'FBLazyVector', :path => "#{prefix}/Libraries/FBLazyVector"
|
|
pod 'FBReactNativeSpec', :path => "#{prefix}/Libraries/FBReactNativeSpec"
|
|
pod 'RCTRequired', :path => "#{prefix}/Libraries/RCTRequired"
|
|
pod 'RCTTypeSafety', :path => "#{prefix}/Libraries/TypeSafety"
|
|
pod 'React', :path => "#{prefix}/"
|
|
pod 'React-Core', :path => "#{prefix}/"
|
|
pod 'React-CoreModules', :path => "#{prefix}/React/CoreModules"
|
|
pod 'React-RCTActionSheet', :path => "#{prefix}/Libraries/ActionSheetIOS"
|
|
pod 'React-RCTAnimation', :path => "#{prefix}/Libraries/NativeAnimation"
|
|
pod 'React-RCTBlob', :path => "#{prefix}/Libraries/Blob"
|
|
pod 'React-RCTImage', :path => "#{prefix}/Libraries/Image"
|
|
pod 'React-RCTLinking', :path => "#{prefix}/Libraries/LinkingIOS"
|
|
pod 'React-RCTNetwork', :path => "#{prefix}/Libraries/Network"
|
|
pod 'React-RCTSettings', :path => "#{prefix}/Libraries/Settings"
|
|
pod 'React-RCTText', :path => "#{prefix}/Libraries/Text"
|
|
pod 'React-RCTVibration', :path => "#{prefix}/Libraries/Vibration"
|
|
pod 'React-Core/RCTWebSocket', :path => "#{prefix}/"
|
|
|
|
unless production
|
|
pod 'React-Core/DevSupport', :path => "#{prefix}/"
|
|
end
|
|
|
|
pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact"
|
|
pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi"
|
|
pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
|
|
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"
|
|
pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker"
|
|
pod 'React-runtimeexecutor', :path => "#{prefix}/ReactCommon/runtimeexecutor"
|
|
pod 'React-perflogger', :path => "#{prefix}/ReactCommon/reactperflogger"
|
|
pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon"
|
|
pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga", :modular_headers => true
|
|
|
|
pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
|
|
pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
|
|
pod 'Folly', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"
|
|
|
|
if fabric_enabled
|
|
pod 'React-Fabric', :path => "#{prefix}/ReactCommon"
|
|
pod 'React-graphics', :path => "#{prefix}/ReactCommon/fabric/graphics"
|
|
pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi"
|
|
pod 'React-RCTFabric', :path => "#{prefix}/React"
|
|
pod 'Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"
|
|
end
|
|
end
|
|
|
|
def use_flipper!(versions = {})
|
|
versions['Flipper'] ||= '~> 0.41.1'
|
|
versions['Flipper-DoubleConversion'] ||= '1.1.7'
|
|
versions['Flipper-Folly'] ||= '~> 2.2'
|
|
versions['Flipper-Glog'] ||= '0.3.6'
|
|
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
|
|
versions['Flipper-RSocket'] ||= '~> 1.1'
|
|
pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
|
|
# List all transitive dependencies for FlipperKit pods
|
|
# to avoid them being linked in Release builds
|
|
pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configuration => 'Debug'
|
|
pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
|
|
pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
|
|
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
|
|
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
|
|
pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
|
|
end
|
|
|
|
# Post Install processing for Flipper
|
|
def flipper_post_install(installer)
|
|
installer.pods_project.targets.each do |target|
|
|
if target.name == 'YogaKit'
|
|
target.build_configurations.each do |config|
|
|
config.build_settings['SWIFT_VERSION'] = '4.1'
|
|
end
|
|
end
|
|
end
|
|
end
|