Skip to content

Commit ef32987

Browse files
committed
Replace RNTester project with CocoaPods managed workspace
1 parent 7c00562 commit ef32987

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+943
-3066
lines changed

.circleci/config.yml

Lines changed: 27 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ executors:
3434
reactnativeios:
3535
<<: *defaults
3636
macos:
37-
xcode: "10.2.0"
37+
xcode: "10.2.1"
3838

3939
# -------------------------
4040
# COMMANDS
@@ -117,6 +117,21 @@ commands:
117117
- ~/Library/Caches/Homebrew
118118
key: v1-brew
119119

120+
with_pods_cache_span:
121+
parameters:
122+
steps:
123+
type: steps
124+
steps:
125+
- restore_cache:
126+
keys:
127+
- v1-pods-{{ checksum "RNTester/Podfile.lock" }}
128+
- v1-pods-
129+
- steps: << parameters.steps >>
130+
- save_cache:
131+
paths:
132+
- RNTester/Pods
133+
key: v1-pods-{{ checksum "RNTester/Podfile.lock" }}
134+
120135
download_gradle_dependencies:
121136
steps:
122137
- restore_cache:
@@ -295,110 +310,27 @@ jobs:
295310
- run_yarn
296311

297312
- run:
298-
name: Print Xcode environment
299-
command: xcodebuild -version
313+
name: Boot iPhone Simulator
314+
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
300315

301316
- run:
302-
name: List available devices
303-
command: instruments -s devices
317+
name: Fetch CocoaPods Specs
318+
command: |
319+
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
304320
305-
- run:
306-
name: Boot iOS Simulator
307-
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
321+
- with_pods_cache_span:
322+
steps:
323+
- run:
324+
name: Generate RNTesterPods Workspace
325+
command: cd RNTester && pod install --verbose
308326

309327
- with_brew_cache_span:
310328
steps:
311329
- brew_install:
312330
package: watchman
313331
- run: touch .watchmanconfig
314332

315-
- run:
316-
name: Start Metro packager
317-
command: yarn start --max-workers=1 || echo "Can't start packager automatically"
318-
background: true
319-
320-
- run:
321-
name: Start WebSocket test server
322-
command: open "./IntegrationTests/launchWebSocketServer.command" || echo "Can't start web socket server automatically"
323-
background: true
324-
325-
- run:
326-
name: Verify RNTester can be built
327-
command: |
328-
source ./scripts/.tests.env
329-
xcodebuild \
330-
-project RNTester/RNTester.xcodeproj \
331-
-scheme RNTester \
332-
-sdk iphonesimulator \
333-
-destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=$IOS_TARGET_OS" \
334-
-UseModernBuildSystem=NO \
335-
build | \
336-
xcpretty --report junit --output "$REPORTS_DIR/junit/ios_buiild/results.xml" && \
337-
exit "${PIPESTATUS[0]}"
338-
339-
- run:
340-
name: Wait for Metro packager
341-
command: |
342-
max_attempts=60
343-
attempt_num=1
344-
until curl -s http://localhost:8081/status | grep "packager-status:running" -q; do
345-
if (( attempt_num == max_attempts )); then
346-
echo "Packager did not respond in time. No more attempts left."
347-
exit 1
348-
else
349-
(( attempt_num++ ))
350-
echo "Packager did not respond. Retrying for attempt number $attempt_num..."
351-
sleep 1
352-
fi
353-
done
354-
echo "Packager is ready!"
355-
356-
- run:
357-
name: Preload the RNTesterApp bundles
358-
command: |
359-
curl --silent 'http://localhost:8081/RNTester/js/RNTesterApp.ios.bundle?platform=ios&dev=true' --output /dev/null
360-
curl --silent 'http://localhost:8081/RNTester/js/RNTesterApp.ios.bundle?platform=ios&dev=true&minify=false' --output /dev/null
361-
curl --silent 'http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=ios&dev=true' --output /dev/null
362-
curl --silent 'http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=ios&dev=true' --output /dev/null
363-
364-
- run:
365-
name: Run RNTester Unit Tests
366-
command: |
367-
source ./scripts/.tests.env
368-
xcodebuild \
369-
-project RNTester/RNTester.xcodeproj \
370-
-scheme RNTester \
371-
-sdk iphonesimulator \
372-
-destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=$IOS_TARGET_OS" \
373-
-UseModernBuildSystem=NO \
374-
-only-testing:RNTesterUnitTests \
375-
build test | \
376-
xcpretty --report junit --output "$REPORTS_DIR/junit/ios_unit_tests/results.xml" && \
377-
exit "${PIPESTATUS[0]}"
378-
379-
- run:
380-
name: Run RNTester Integration Tests
381-
command: |
382-
source ./scripts/.tests.env
383-
xcodebuild \
384-
-project RNTester/RNTester.xcodeproj \
385-
-scheme RNTester \
386-
-sdk iphonesimulator \
387-
-destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=$IOS_TARGET_OS" \
388-
-UseModernBuildSystem=NO \
389-
-only-testing:RNTesterIntegrationTests \
390-
build test | \
391-
xcpretty --report junit --output "$REPORTS_DIR/junit/ios_integration_tests/results.xml" && \
392-
exit "${PIPESTATUS[0]}"
393-
394-
- run:
395-
name: Stop Metro packager and WebSocket test server
396-
command: |
397-
# kill whatever is occupying port 8081 (packager)
398-
lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill
399-
# kill whatever is occupying port 5555 (web socket server)
400-
lsof -i tcp:5555 | awk 'NR!=1 {print $2}' | xargs kill
401-
333+
- run: yarn test-ios
402334
- store_test_results:
403335
path: ~/reports/junit
404336

@@ -429,8 +361,6 @@ jobs:
429361
- run: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
430362
- brew_install:
431363
package: applesimutils
432-
- brew_install:
433-
package: watchman
434364

435365
# Configure Watchman
436366
- run: touch .watchmanconfig

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ package-lock.json
7171
RNTester/build
7272

7373
# CocoaPods
74+
!Podfile.lock
75+
/RNTester/Pods/
76+
/RNTester/RNTesterPods.xcworkspace/
7477
/template/ios/Pods/
7578
/template/ios/Podfile.lock
76-
RNTester/RNTesterPods.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

RNTester/.eslintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

RNTester/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

RNTester/Podfile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ platform :ios, '9.0'
22

33
require_relative '../scripts/autolink-ios'
44

5-
target 'RNTester' do
5+
def pods()
66
# Uncomment for Swift
77
# use_frameworks!
88

@@ -21,3 +21,23 @@ target 'RNTester' do
2121
# To use fabric: add `fabric_enabled` option to the use_react_native method above, like below
2222
# use_react_native!(path: "..", turbo_modules_enabled: true, fabric_enabled: true)
2323
end
24+
25+
target 'RNTester' do
26+
pods()
27+
end
28+
29+
target 'RNTesterUnitTests' do
30+
pods()
31+
pod 'React-RCTTest', :path => "RCTTest"
32+
end
33+
34+
target 'RNTesterIntegrationTests' do
35+
pods()
36+
pod 'React-RCTTest', :path => "RCTTest"
37+
end
38+
39+
post_install do |installer|
40+
installer.pods_project.targets.each do |target|
41+
puts target.name
42+
end
43+
end

RNTester/Podfile.lock

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ PODS:
4040
- React-DevSupport (1000.0.0):
4141
- React-Core (= 1000.0.0)
4242
- React-RCTWebSocket (= 1000.0.0)
43-
- React-fishhook (1000.0.0)
43+
- React-jscallinvoker (1000.0.0):
44+
- Folly (= 2018.10.22.00)
45+
- React-cxxreact (= 1000.0.0)
4446
- React-jsi (1000.0.0):
4547
- boost-for-react-native (= 1.63.0)
4648
- DoubleConversion
@@ -78,23 +80,26 @@ PODS:
7880
- React-Core (= 1000.0.0)
7981
- React-RCTSettings (1000.0.0):
8082
- React-Core (= 1000.0.0)
83+
- React-RCTTest (1000.0.0):
84+
- React-Core (= 1000.0.0)
8185
- React-RCTText (1000.0.0):
8286
- React-Core (= 1000.0.0)
8387
- React-RCTVibration (1000.0.0):
8488
- React-Core (= 1000.0.0)
8589
- React-RCTWebSocket (1000.0.0):
8690
- React-Core (= 1000.0.0)
87-
- React-fishhook (= 1000.0.0)
8891
- React-turbomodule-core (1000.0.0):
8992
- Folly (= 2018.10.22.00)
9093
- React-Core (= 1000.0.0)
9194
- React-cxxreact (= 1000.0.0)
95+
- React-jscallinvoker (= 1000.0.0)
9296
- React-jsi (= 1000.0.0)
9397
- React-turbomodule-core/core-ios (= 1000.0.0)
9498
- React-turbomodule-core/core-ios (1000.0.0):
9599
- Folly (= 2018.10.22.00)
96100
- React-Core (= 1000.0.0)
97101
- React-cxxreact (= 1000.0.0)
102+
- React-jscallinvoker (= 1000.0.0)
98103
- React-jsi (= 1000.0.0)
99104
- React-turbomodule-samples (1000.0.0):
100105
- Folly (= 2018.10.22.00)
@@ -120,7 +125,7 @@ DEPENDENCIES:
120125
- React-Core (from `../React`)
121126
- React-cxxreact (from `../ReactCommon/cxxreact`)
122127
- React-DevSupport (from `../React`)
123-
- React-fishhook (from `../Libraries/fishhook`)
128+
- React-jscallinvoker (from `../ReactCommon/jscallinvoker`)
124129
- React-jsi (from `../ReactCommon/jsi`)
125130
- React-jsiexecutor (from `../ReactCommon/jsiexecutor`)
126131
- React-jsinspector (from `../ReactCommon/jsinspector`)
@@ -132,6 +137,7 @@ DEPENDENCIES:
132137
- React-RCTNetwork (from `../Libraries/Network`)
133138
- React-RCTPushNotification (from `../Libraries/PushNotificationIOS`)
134139
- React-RCTSettings (from `../Libraries/Settings`)
140+
- React-RCTTest (from `RCTTest`)
135141
- React-RCTText (from `../Libraries/Text`)
136142
- React-RCTVibration (from `../Libraries/Vibration`)
137143
- React-RCTWebSocket (from `../Libraries/WebSocket`)
@@ -160,8 +166,8 @@ EXTERNAL SOURCES:
160166
:path: "../ReactCommon/cxxreact"
161167
React-DevSupport:
162168
:path: "../React"
163-
React-fishhook:
164-
:path: "../Libraries/fishhook"
169+
React-jscallinvoker:
170+
:path: "../ReactCommon/jscallinvoker"
165171
React-jsi:
166172
:path: "../ReactCommon/jsi"
167173
React-jsiexecutor:
@@ -184,6 +190,8 @@ EXTERNAL SOURCES:
184190
:path: "../Libraries/PushNotificationIOS"
185191
React-RCTSettings:
186192
:path: "../Libraries/Settings"
193+
React-RCTTest:
194+
:path: RCTTest
187195
React-RCTText:
188196
:path: "../Libraries/Text"
189197
React-RCTVibration:
@@ -202,30 +210,31 @@ SPEC CHECKSUMS:
202210
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
203211
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
204212
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
205-
React: e7b61c9123f89c4cd9becea2122af02568be6e13
206-
React-ART: 3dba78ec04b585a82456d1df4bda7a08dbc83a8d
207-
React-Core: d1c3aa4b1c5c57bf839de3c83396b59c1efbf1ba
208-
React-cxxreact: 5f2b678adbe8ff5256801603e1b496e481bc2430
209-
React-DevSupport: 9bde3ce4f7707d9487759101ea3188f4f07c9003
210-
React-fishhook: a9a43c2c84ab2519809810bcdd363e2774007c69
211-
React-jsi: cdf32eb002ff3e243364a1abb71925e0e93003db
212-
React-jsiexecutor: 6e53c44a5371297f0c9cc39780f12cb3efba3b81
213-
React-jsinspector: 2f42a591151e828d0422cbd3b609eedcb920d58e
214-
React-RCTActionSheet: 4ad4bfac1ba9ec020edf278362855448d607cafd
215-
React-RCTAnimation: f050e9fbe85e5616f74cea7a2557bdfb6be73cee
216-
React-RCTBlob: 9f907aab3417a43bbda84aef76f88ee528e877d4
217-
React-RCTImage: 4234a754ebdb922416f5f77cff121c680fd3ccbe
218-
React-RCTLinking: 3a52500942cc73999df19f541b7bda5887c3c43d
219-
React-RCTNetwork: 2042d2648e1160770ac0e5068bb5b648c03296a5
220-
React-RCTPushNotification: 3cfbf863d0597b5da80a15c9a9285a0ad89b23ba
221-
React-RCTSettings: 8099c9d904c0fbe46c463de8791478b5bc72809e
222-
React-RCTText: c4a643a08fce4727316366fea5ad17fa14f72f54
223-
React-RCTVibration: c5933466242187bffe55fa5496f841e04db66c8a
224-
React-RCTWebSocket: 233c66a6394de3816ee46861bbe0dba9f83e45a0
225-
React-turbomodule-core: 7ae77c38b85f6f81be40c0c3dc456d3a5fda4797
226-
React-turbomodule-samples: 483f2c80e81b89197737828405a0ac27c77f58b5
227-
yoga: 56698cdff46e3dbb7aa71fd2fd7dc0ce650dc0fb
213+
React: 2e58e540f4553f1cbdc348852fb5a18e8036ce18
214+
React-ART: d11f35a949c76d9f263c97f762c6c303f5cbbb23
215+
React-Core: ff871ac068fe518813b83cc78068b8800f992193
216+
React-cxxreact: dc29ef7ab760b0ad26a90c52f0b54cbcfdcd4520
217+
React-DevSupport: b7a914dfe7b7b05ca98e1b62fd2822c32c84cb89
218+
React-jscallinvoker: 34b1fff8f149548ee69cd3a93c8e7b283253e888
219+
React-jsi: b057ecb52ee05096ef227793b727f92222d396ef
220+
React-jsiexecutor: d7bfcd666086fc898833306adc2a64a331dd092a
221+
React-jsinspector: 104adf76e7bc6ff2517f06d7ad66ef67b8729284
222+
React-RCTActionSheet: 5cc28815b372fd561c576a9c353fb7fb9b8f56c4
223+
React-RCTAnimation: 48d253c3b508bd1212464a4ed38401e054520e9a
224+
React-RCTBlob: 33a7e02859b543a5a9f43b6b9b775c44238ff9d5
225+
React-RCTImage: f2699454ce91c56f0d78509f02af1ef87d3b37c0
226+
React-RCTLinking: cb70f815dd967dffedc6c10ae84ad5073d53d2fa
227+
React-RCTNetwork: 73894a3c8af40e9ca7eb8972d390b33ae7f99208
228+
React-RCTPushNotification: bc23adf01bb646e6f528b866e7d72f896c39bd05
229+
React-RCTSettings: b1c408b79296c4d9274aa367b31fa627eddfa1e6
230+
React-RCTTest: 11bcf239072424ee32f4c5fe6c089e0e25e6afe3
231+
React-RCTText: 0a2d48035fbbe39de8fc11d9c564ac68e498674e
232+
React-RCTVibration: ff68f6b4a83b339f0655c1c141e9231df24a2c59
233+
React-RCTWebSocket: 39ac3feec09633f182d7e20750e882fb11a81a4c
234+
React-turbomodule-core: b0a9a3898307227e13c6df01e28d63e820cd8d45
235+
React-turbomodule-samples: dd336cec1bd008b3165ba7b1ec3b56d0c5763fea
236+
yoga: b523060bb8b7da7527332bba86b4efa71bb56a4a
228237

229-
PODFILE CHECKSUM: bb578b8286c0068879a41ac092c9690cc3ede523
238+
PODFILE CHECKSUM: bdc86d3bfde60c2637cfa8c4ed81afeaa2aaf6a3
230239

231-
COCOAPODS: 1.6.3
240+
COCOAPODS: 1.7.1

RNTester/README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,9 @@ Before running the app, make sure you ran:
1414

1515
Both macOS and Xcode are required.
1616

17-
- Open `RNTester/RNTester.xcodeproj` in Xcode
18-
- Hit the Run button
19-
20-
See [Running on device](https://facebook.github.io/react-native/docs/running-on-device.html) if you want to use a physical device.
21-
22-
### Running on iOS with CocoaPods
23-
24-
Similar to above, you can build the app via Xcode with help of CocoaPods.
25-
26-
- Install [CocoaPods](http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#3-install-cocoapods)
17+
- Install CocoaPods. We installing CocoaPods using [Homebrew](http://brew.sh/): `brew install cocoapods`
2718
- Run `cd RNTester; pod install`
28-
- Open the generated `RNTesterPods.xcworkspace` (this is not checked in). Do not open `RNTesterPods.xcodeproj` directly.
19+
- Open the generated `RNTesterPods.xcworkspace`. This is not checked in, as it is generated by CocoaPods. Do not open `RNTesterPods.xcodeproj` directly.
2920

3021
### Running on Android
3122

0 commit comments

Comments
 (0)