mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1cb0a3342a
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43068 This diff adds `react-native-test-library` package. It contains native module and native component example, and targets both the new and the old architecture. It has structure similar to many OSS React Native libraries, and is supposed to be used to test the integration with third-party libraries. It is integrated with RNTester as the **OSS Library Example** screen. {F1457510909} **Change Background** tests native commands. **Set Opacity** tests native props. **Get Random Number** tests native module. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D50793835 fbshipit-source-id: ff6daefab10e6e9f13049e3013f8f63cfa8a929e
84 lines
2.5 KiB
Ruby
84 lines
2.5 KiB
Ruby
require_relative '../react-native/scripts/react_native_pods'
|
|
|
|
source 'https://cdn.cocoapods.org/'
|
|
platform :ios, min_ios_version_supported
|
|
|
|
cmake_path = `command -v cmake`
|
|
|
|
if cmake_path == ""
|
|
brew_path = `command -v brew`
|
|
if brew_path != ""
|
|
Pod::UI.puts "Installing CMake using brew. This is required to build RNTester.".red
|
|
`brew install cmake`
|
|
else
|
|
Pod::UI.puts "In order to build RNTester locally, you need cmake installed, please install it and try again".red
|
|
return
|
|
end
|
|
else
|
|
Pod::UI.puts "Cmake found at: #{cmake_path}".green
|
|
end
|
|
|
|
|
|
prepare_react_native_project!
|
|
|
|
IN_CI = ENV['CI'] == 'true'
|
|
|
|
@prefix_path = "../react-native"
|
|
|
|
linkage = ENV['USE_FRAMEWORKS']
|
|
USE_FRAMEWORKS = linkage != nil
|
|
if USE_FRAMEWORKS
|
|
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
|
|
use_frameworks! :linkage => linkage.to_sym
|
|
end
|
|
|
|
def pods(target_name, options = {})
|
|
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 "Configuring #{target_name} with Fabric #{fabric_enabled ? "enabled" : "disabled"}.#{hermes_enabled ? " Using Hermes engine." : ""}"
|
|
|
|
use_react_native!(
|
|
path: @prefix_path,
|
|
fabric_enabled: fabric_enabled,
|
|
hermes_enabled: hermes_enabled,
|
|
app_path: "#{Dir.pwd}",
|
|
config_file_dir: "#{Dir.pwd}/node_modules",
|
|
production: false, #deprecated
|
|
)
|
|
pod 'ReactCommon-Samples', :path => "#{@prefix_path}/ReactCommon/react/nativemodule/samples"
|
|
|
|
# Additional Pods which aren't included in the default Podfile
|
|
pod 'React-RCTPushNotification', :path => "#{@prefix_path}/Libraries/PushNotificationIOS"
|
|
# Additional Pods which are classed as unstable
|
|
|
|
# RNTester native modules and components
|
|
pod 'ScreenshotManager', :path => "NativeModuleExample"
|
|
pod 'MyNativeView', :path => "NativeComponentExample"
|
|
pod 'NativeCxxModuleExample', :path => "NativeCxxModuleExample"
|
|
pod 'OSSLibraryExample', :path => '../react-native-test-library'
|
|
end
|
|
|
|
target 'RNTester' do
|
|
pods('RNTester')
|
|
end
|
|
|
|
target 'RNTesterUnitTests' do
|
|
pods('RNTesterUnitTests')
|
|
pod 'React-RCTTest', :path => "./RCTTest"
|
|
pod 'OCMock', '~> 3.9.1'
|
|
end
|
|
|
|
target 'RNTesterIntegrationTests' do
|
|
pods('RNTesterIntegrationTests')
|
|
pod 'React-RCTTest', :path => "./RCTTest"
|
|
end
|
|
|
|
post_install do |installer|
|
|
react_native_post_install(installer, @prefix_path, :mac_catalyst_enabled => false)
|
|
end
|