Skip to content

Commit

Permalink
Add CocoaPods Podfile to the project template (#23563)
Browse files Browse the repository at this point in the history
Summary:
CocoaPods makes it easier to add new iOS dependencies to a project without having to manually edit Xcode projects. Editing Xcode projects is time consuming and merging changes to them difficult. Automating the changes to Xcode project `react-native link` is error prone. CocoaPods is a de-facto standard way to manage iOS dependencies and a central part of unimodules and upcoming improvements to `react-native link`.

This PR adds a `Podfile` to the default project template of React Native. To use a project with CocoaPods, after creating it, run `cd ios; pod install` and use the created `<projectname>.xcworkspace` file instead of the `.xcodeproj` file. (We could make this a part of `react-native init` so you only need to run one command when creating a project.)

[iOS] [Added] - Add CocoaPods Podfile to the project template
Pull Request resolved: #23563

Differential Revision: D14576505

Pulled By: cpojer

fbshipit-source-id: f6c9e93d61a52ad445d2931ccc4933d559a6ec1a
  • Loading branch information
fson authored and facebook-github-bot committed Mar 22, 2019
1 parent 27e7279 commit cd8064b
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 766 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ package-lock.json
# ReactCommon subdir shouldn't have Xcode project
/ReactCommon/**/*.xcodeproj
RNTester/build

# CocoaPods
/template/ios/Pods/
/template/ios/Podfile.lock
4 changes: 4 additions & 0 deletions scripts/run-ci-e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ try {
'response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.bundle?platform=ios&dev=true)',
);
echo(`Starting packager server, ${SERVER_PID}`);
echo('Running pod install');
exec('pod install');
echo('Executing ' + iosTestType + ' end-to-end test');
if (
tryExecNTimes(() => {
Expand All @@ -204,6 +206,8 @@ try {
return exec(
[
'xcodebuild',
'-workspace',
'"EndToEndTest.xcworkspace"',
'-destination',
`"${destination}"`,
'-scheme',
Expand Down
3 changes: 3 additions & 0 deletions template/_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ buck-out/

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
Loading

0 comments on commit cd8064b

Please sign in to comment.