mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-17 01:11:31 +08:00
Summary: Simplifies the code anyone on iOS using RN has _to see_. In this case, React Native knows that everyone probably wants all these imports (unless they're using dev mode) and so we can auto-import the pod specs for a user from inside the lib. Basically auto-link for the React side. [iOS] [Added] - Adds a ruby function which imports the Pods for RN, so that users only have to include this function and it can change per RN version. Pull Request resolved: https://github.com/facebook/react-native/pull/24555 Differential Revision: D15044780 Pulled By: cpojer fbshipit-source-id: c3702a52104706def51da6f1d11ab966d57d1edb
38 lines
1.7 KiB
Ruby
38 lines
1.7 KiB
Ruby
def use_react_native! (options={})
|
|
|
|
# The prefix to the react-native
|
|
prefix = options[:path] ||= "../node_modules/react-native"
|
|
|
|
# Include DevSupport dependency
|
|
production = options[:production] ||= false
|
|
|
|
# The Pods which should be included in all projects
|
|
pod 'React', :path => "#{prefix}/"
|
|
pod 'React-Core', :path => "#{prefix}/React"
|
|
pod 'React-fishhook', :path => "#{prefix}/Libraries/fishhook"
|
|
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-RCTWebSocket', :path => "#{prefix}/Libraries/WebSocket"
|
|
|
|
unless production
|
|
pod 'React-DevSupport', :path => "#{prefix}/React"
|
|
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 'yoga', :path => "#{prefix}/ReactCommon/yoga"
|
|
|
|
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"
|
|
end
|