mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a35efb9400
Summary: We use this for RN tester but it is not currently included in npm releases. It cleans up the podfile a lot and will make adding / removing pods easier in the future since it won't require users to update their project. ## Changelog [iOS] [Added] - Use autolink script in template on iOS Pull Request resolved: https://github.com/facebook/react-native/pull/27984 Test Plan: Not sure if there is a way to end to end test this but I've been using this autolink script in my fork for a while. Differential Revision: D19787729 Pulled By: cpojer fbshipit-source-id: b843ea723085830f13e8f0149833d1beb1efdfac
69 lines
2.1 KiB
Ruby
69 lines
2.1 KiB
Ruby
platform :ios, '10.0'
|
|
require_relative '../node_modules/react-native/scripts/autolink-ios'
|
|
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
|
|
# Add Flipper Pods
|
|
def flipper_pods()
|
|
flipperkit_version = '0.30.0'
|
|
pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
|
|
pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
|
|
pod 'FlipperKit/FlipperKitReactPlugin', '~>' + flipperkit_version, :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
|
|
file_name = Dir.glob("*.xcodeproj")[0]
|
|
app_project = Xcodeproj::Project.open(file_name)
|
|
app_project.native_targets.each do |target|
|
|
target.build_configurations.each do |config|
|
|
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
|
|
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
|
|
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
|
|
cflags << '-DFB_SONARKIT_ENABLED=1'
|
|
end
|
|
config.build_settings['OTHER_CFLAGS'] = cflags
|
|
end
|
|
app_project.save
|
|
end
|
|
installer.pods_project.save
|
|
end
|
|
|
|
|
|
target 'HelloWorld' do
|
|
# Pods for HelloWorld
|
|
use_react_native!
|
|
|
|
target 'HelloWorldTests' do
|
|
inherit! :complete
|
|
# Pods for testing
|
|
end
|
|
|
|
use_native_modules!
|
|
|
|
# For enabling Flipper.
|
|
# Note that if you have use_frameworks!, flipper will not work.
|
|
# Disable these lines if you are using use_frameworks!
|
|
flipper_pods()
|
|
post_install do |installer|
|
|
flipper_post_install(installer)
|
|
end
|
|
end
|
|
|
|
target 'HelloWorld-tvOS' do
|
|
# Pods for HelloWorld-tvOS
|
|
|
|
target 'HelloWorld-tvOSTests' do
|
|
inherit! :search_paths
|
|
# Pods for testing
|
|
end
|
|
end
|