Skip to content

Commit 326248e

Browse files
ortafacebook-github-bot
authored andcommitted
Adds a ruby file in RN which reflects what Podspecs should be imported by default (react#24555)
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: react#24555 Differential Revision: D15044780 Pulled By: cpojer fbshipit-source-id: c3702a52104706def51da6f1d11ab966d57d1edb
1 parent 67be819 commit 326248e

3 files changed

Lines changed: 70 additions & 53 deletions

File tree

RNTester/Podfile

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,28 @@
11
platform :ios, '9.0'
22

3+
require_relative '../scripts/autolink-ios'
4+
35
target 'RNTester' do
46
# Uncomment for Swift
57
# use_frameworks!
68

79
project 'RNTesterPods.xcodeproj'
10+
use_react_native!(path: "..")
811

9-
pod 'React', :path => '../'
10-
pod 'React-ART', :path => '../Libraries/ART'
11-
pod 'React-Core', :path => '../React'
12-
pod 'React-DevSupport', :path => '../React'
13-
pod 'React-fishhook', :path => '../Libraries/fishhook'
14-
pod 'React-RCTActionSheet', :path => '../Libraries/ActionSheetIOS'
15-
pod 'React-RCTAnimation', :path => '../Libraries/NativeAnimation'
16-
pod 'React-RCTBlob', :path => '../Libraries/Blob'
12+
# Additional Pods which aren't included in the default Podfile
1713
pod 'React-RCTCameraRoll', :path => '../Libraries/CameraRoll'
18-
pod 'React-RCTImage', :path => '../Libraries/Image'
19-
pod 'React-RCTLinking', :path => '../Libraries/LinkingIOS'
20-
pod 'React-RCTNetwork', :path => '../Libraries/Network'
14+
pod 'React-ART', :path => '../Libraries/ART'
2115
pod 'React-RCTPushNotification', :path => '../Libraries/PushNotificationIOS'
22-
pod 'React-RCTSettings', :path => '../Libraries/Settings'
23-
pod 'React-RCTText', :path => '../Libraries/Text'
24-
pod 'React-RCTVibration', :path => '../Libraries/Vibration'
25-
pod 'React-RCTWebSocket', :path => '../Libraries/WebSocket'
2616

17+
# Additional Pods which are classed as unstable
18+
#
2719
# Fabric Pods, uncomment these to enable in RNTester
2820
# pod 'React-Fabric', :path => '../ReactCommon'
2921
# pod 'React-graphics', :path => '../ReactCommon/fabric/graphics'
3022
# pod 'React-jsi/Fabric', :path => '../ReactCommon/jsi'
3123
# pod 'React-RCTFabric', :path => '../React'
3224
# pod 'Folly/Fabric', :podspec => '../third-party-podspecs/Folly.podspec'
3325

34-
pod 'React-cxxreact', :path => '../ReactCommon/cxxreact'
35-
pod 'React-jsi', :path => '../ReactCommon/jsi'
36-
pod 'React-jsiexecutor', :path => '../ReactCommon/jsiexecutor'
37-
pod 'React-jsinspector', :path => '../ReactCommon/jsinspector'
38-
pod 'yoga', :path => '../ReactCommon/yoga'
39-
4026
pod 'React-turbomodule-core', :path => '../ReactCommon/turbomodule/core'
4127
pod 'React-turbomodule-samples', :path => '../ReactCommon/turbomodule/samples'
42-
43-
# Third party deps podspec link
44-
pod 'DoubleConversion', :podspec => '../third-party-podspecs/DoubleConversion.podspec'
45-
pod 'glog', :podspec => '../third-party-podspecs/glog.podspec'
46-
pod 'Folly', :podspec => '../third-party-podspecs/Folly.podspec'
47-
4828
end

RNTester/Podfile.lock

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -208,31 +208,31 @@ SPEC CHECKSUMS:
208208
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
209209
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
210210
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
211-
React: 7c652b87c228731c51ab5764de68b6c17e6342be
212-
React-ART: 28f8815acbbc4816cec14866b59911a83eb780ed
213-
React-Core: 85bf24f380e5228013f5f75d7c1b6338a003a2b2
214-
React-cxxreact: 7e670bad16eb78fa889573d931c12bb1003a3598
215-
React-DevSupport: f34768e3aad3e59ee9800c752a78bc6cb24d0f75
216-
React-fishhook: d2a67f0eaeef9fe0dca0526812ca8fcff4b6f17b
217-
React-jsi: ae62f3eff7357d3c11722653d13d0c6399b5c372
218-
React-jsiexecutor: ee776181a1ba315dbae9500c4dba5cb94ea3c5d2
219-
React-jsinspector: ea0a218071a11c3687cef2480580180caa6a64c0
220-
React-RCTActionSheet: caf6532394bdbbe0fc0ec2363c84f26bcfcdd36a
221-
React-RCTAnimation: b324c6eb699637c735650c6180e13d003eeb0e56
222-
React-RCTBlob: 069290c8db758bb1d77523a06d117dd668b6cef3
223-
React-RCTCameraRoll: 353af870a0acd5ebb0bcf6a8187ed78d94c4c65e
224-
React-RCTImage: 012d845d919177e2726743ad06052dda66592760
225-
React-RCTLinking: c6fe7b82bed97ce72203b2ce2f4aac87b1e2647f
226-
React-RCTNetwork: 2a2b22a17cd965de53ba21c5ca392d0da84ef322
227-
React-RCTPushNotification: 13729b4a2b63b191f42ba7230a69f462f3b5a7f9
228-
React-RCTSettings: e36d7f7d566b80d4363176c2f76cc5eccfdd0ae1
229-
React-RCTText: 469ec754592c92fc639825e558908c2f0e783e2c
230-
React-RCTVibration: ade3c169b54f3bc16c9a9918e17e48ef66aee6ba
231-
React-RCTWebSocket: 90b78ed51d53d17db417d3956decba3f7ace58e4
232-
React-turbomodule-core: 67a461c91319c0bf2228dc46c7dafbbb921eebee
233-
React-turbomodule-samples: b28927d482d6fcfc3cbe2fd25f304799d2ff9bb7
234-
yoga: 542cb34fe3bca476487e08eb516dd640ea996a65
211+
React: e7b61c9123f89c4cd9becea2122af02568be6e13
212+
React-ART: 3dba78ec04b585a82456d1df4bda7a08dbc83a8d
213+
React-Core: d1c3aa4b1c5c57bf839de3c83396b59c1efbf1ba
214+
React-cxxreact: 5f2b678adbe8ff5256801603e1b496e481bc2430
215+
React-DevSupport: 9bde3ce4f7707d9487759101ea3188f4f07c9003
216+
React-fishhook: a9a43c2c84ab2519809810bcdd363e2774007c69
217+
React-jsi: cdf32eb002ff3e243364a1abb71925e0e93003db
218+
React-jsiexecutor: 6e53c44a5371297f0c9cc39780f12cb3efba3b81
219+
React-jsinspector: 2f42a591151e828d0422cbd3b609eedcb920d58e
220+
React-RCTActionSheet: 4ad4bfac1ba9ec020edf278362855448d607cafd
221+
React-RCTAnimation: f050e9fbe85e5616f74cea7a2557bdfb6be73cee
222+
React-RCTBlob: 9f907aab3417a43bbda84aef76f88ee528e877d4
223+
React-RCTCameraRoll: 288b1007d8e540771b917f89d7d99118a3477ee1
224+
React-RCTImage: 4234a754ebdb922416f5f77cff121c680fd3ccbe
225+
React-RCTLinking: 3a52500942cc73999df19f541b7bda5887c3c43d
226+
React-RCTNetwork: 2042d2648e1160770ac0e5068bb5b648c03296a5
227+
React-RCTPushNotification: 3cfbf863d0597b5da80a15c9a9285a0ad89b23ba
228+
React-RCTSettings: 8099c9d904c0fbe46c463de8791478b5bc72809e
229+
React-RCTText: c4a643a08fce4727316366fea5ad17fa14f72f54
230+
React-RCTVibration: c5933466242187bffe55fa5496f841e04db66c8a
231+
React-RCTWebSocket: 233c66a6394de3816ee46861bbe0dba9f83e45a0
232+
React-turbomodule-core: 7ae77c38b85f6f81be40c0c3dc456d3a5fda4797
233+
React-turbomodule-samples: 483f2c80e81b89197737828405a0ac27c77f58b5
234+
yoga: 56698cdff46e3dbb7aa71fd2fd7dc0ce650dc0fb
235235

236-
PODFILE CHECKSUM: f7d0a09c9ea25315395b7248591d4a372b87cf3f
236+
PODFILE CHECKSUM: bb578b8286c0068879a41ac092c9690cc3ede523
237237

238-
COCOAPODS: 1.6.1
238+
COCOAPODS: 1.6.3

scripts/autolink-ios.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
def use_react_native! (options={})
2+
3+
# The prefix to the react-native
4+
prefix = options[:path] ||= "../node_modules/react-native"
5+
6+
# Include DevSupport dependency
7+
production = options[:production] ||= false
8+
9+
# The Pods which should be included in all projects
10+
pod 'React', :path => "#{prefix}/"
11+
pod 'React-Core', :path => "#{prefix}/React"
12+
pod 'React-fishhook', :path => "#{prefix}/Libraries/fishhook"
13+
pod 'React-RCTActionSheet', :path => "#{prefix}/Libraries/ActionSheetIOS"
14+
pod 'React-RCTAnimation', :path => "#{prefix}/Libraries/NativeAnimation"
15+
pod 'React-RCTBlob', :path => "#{prefix}/Libraries/Blob"
16+
pod 'React-RCTImage', :path => "#{prefix}/Libraries/Image"
17+
pod 'React-RCTLinking', :path => "#{prefix}/Libraries/LinkingIOS"
18+
pod 'React-RCTNetwork', :path => "#{prefix}/Libraries/Network"
19+
pod 'React-RCTSettings', :path => "#{prefix}/Libraries/Settings"
20+
pod 'React-RCTText', :path => "#{prefix}/Libraries/Text"
21+
pod 'React-RCTVibration', :path => "#{prefix}/Libraries/Vibration"
22+
pod 'React-RCTWebSocket', :path => "#{prefix}/Libraries/WebSocket"
23+
24+
unless production
25+
pod 'React-DevSupport', :path => "#{prefix}/React"
26+
end
27+
28+
pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact"
29+
pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi"
30+
pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
31+
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"
32+
pod 'yoga', :path => "#{prefix}/ReactCommon/yoga"
33+
34+
pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
35+
pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
36+
pod 'Folly', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"
37+
end

0 commit comments

Comments
 (0)