From a35efb94006bfa3f541bf3fc3ab5262740f00525 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 7 Feb 2020 02:49:03 -0800 Subject: [PATCH] Use autolink script in template on iOS (#27984) 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 --- package.json | 1 + scripts/autolink-ios.rb | 2 +- template/ios/Podfile | 32 ++------------------------------ 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index c9a72d15d72547..b25085bca5024f 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "ReactCommon", "README.md", "rn-get-polyfills.js", + "scripts/autolink-ios.rb", "scripts/compose-source-maps.js", "scripts/ios-configure-glog.sh", "scripts/launchPackager.bat", diff --git a/scripts/autolink-ios.rb b/scripts/autolink-ios.rb index 13e7a377aa9473..0f798f6e6eed9a 100644 --- a/scripts/autolink-ios.rb +++ b/scripts/autolink-ios.rb @@ -43,7 +43,7 @@ def use_react_native! (options={}) pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector" pod 'ReactCommon/callinvoker', :path => "#{prefix}/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon" - pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga" + 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" diff --git a/template/ios/Podfile b/template/ios/Podfile index e20ae8066264a6..1c553968939e4a 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -1,4 +1,5 @@ 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 @@ -39,36 +40,7 @@ end target 'HelloWorld' do # Pods for HelloWorld - pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" - pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" - pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" - pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" - pod 'React', :path => '../node_modules/react-native/' - pod 'React-Core', :path => '../node_modules/react-native/' - pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' - pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' - pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' - pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' - pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' - pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' - pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' - pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' - pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' - pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' - pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' - pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' - - pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' - pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' - pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' - pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' - pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon" - pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" - pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true - - pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' - pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' - pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' + use_react_native! target 'HelloWorldTests' do inherit! :complete