mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This Diff adds a couple of APIs to the `react_native_pods.rb` file to simplify further the migration to the New Architecture for the iOS app. Specifically, it aims to simplify [this](https://reactnative.dev/docs/next/new-architecture-app-intro#ios---build-the-project) steps by offering a RN-managed min version and creating the .xcode.env file for the user if it is missing. ## Changelog [iOS][Added] - Add new API to simplify app migration Reviewed By: cortinico Differential Revision: D39469599 fbshipit-source-id: f0323e86c83c2731671fcd5bb4288071304bb43b
71 lines
2.2 KiB
Ruby
71 lines
2.2 KiB
Ruby
require_relative '../../scripts/react_native_pods'
|
|
|
|
source 'https://cdn.cocoapods.org/'
|
|
platform :ios, min_ios_version_supported
|
|
|
|
prepare_react_native_project!
|
|
|
|
USE_FRAMEWORKS = ENV['USE_FRAMEWORKS'] == '1'
|
|
IN_CI = ENV['CI'] == 'true'
|
|
|
|
@prefix_path = "../.."
|
|
|
|
if USE_FRAMEWORKS
|
|
puts "Installing pods with use_frameworks!"
|
|
use_frameworks!
|
|
end
|
|
|
|
def pods(options = {}, use_flipper: !IN_CI && !USE_FRAMEWORKS)
|
|
project 'RNTesterPods.xcodeproj'
|
|
|
|
fabric_enabled = true
|
|
|
|
# Hermes is now enabled by default.
|
|
# The following line will only disable Hermes if the USE_HERMES envvar is SET to a value other than 1 (e.g. USE_HERMES=0).
|
|
hermes_enabled = !ENV.has_key?('USE_HERMES') || ENV['USE_HERMES'] == '1'
|
|
puts "Building RNTester with Fabric #{fabric_enabled ? "enabled" : "disabled"}.#{hermes_enabled ? " Using Hermes engine." : ""}"
|
|
|
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
# Custom fabric component is only supported when using codegen discovery.
|
|
pod 'MyNativeView', :path => "NativeComponentExample"
|
|
end
|
|
|
|
use_react_native!(
|
|
path: @prefix_path,
|
|
fabric_enabled: fabric_enabled,
|
|
hermes_enabled: hermes_enabled,
|
|
flipper_configuration: use_flipper ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,
|
|
app_path: "#{Dir.pwd}",
|
|
config_file_dir: "#{Dir.pwd}/node_modules",
|
|
production: !ENV['PRODUCTION'].nil?
|
|
)
|
|
pod 'ReactCommon/turbomodule/samples', :path => "#{@prefix_path}/ReactCommon"
|
|
|
|
# Additional Pods which aren't included in the default Podfile
|
|
pod 'React-RCTPushNotification', :path => "#{@prefix_path}/Libraries/PushNotificationIOS"
|
|
pod 'Yoga', :path => "#{@prefix_path}/ReactCommon/yoga", :modular_headers => true
|
|
# Additional Pods which are classed as unstable
|
|
|
|
# RNTester native modules and components
|
|
pod 'ScreenshotManager', :path => "NativeModuleExample"
|
|
end
|
|
|
|
target 'RNTester' do
|
|
pods()
|
|
end
|
|
|
|
target 'RNTesterUnitTests' do
|
|
pods()
|
|
pod 'React-RCTTest', :path => "./RCTTest"
|
|
end
|
|
|
|
target 'RNTesterIntegrationTests' do
|
|
pods()
|
|
pod 'React-RCTTest', :path => "./RCTTest"
|
|
end
|
|
|
|
post_install do |installer|
|
|
react_native_post_install(installer, @prefix_path, :mac_catalyst_enabled => false)
|
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
end
|