-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bundler #27
base: main
Are you sure you want to change the base?
Add bundler #27
Changes from all commits
dc9d56c
7255ddb
7024994
ed4d34e
3b8fd60
7f24633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,53 @@ We prefer to keep our development environment as close to "stock" as possible. T | |
|
||
We make use of [GitHub's Swift gitignore](https://github.com/github/gitignore/blob/master/Swift.gitignore) as the default gitignore for our projects. The only change that we typically make is uncommenting the `Pods/` line so that the [`Pods` folder isn't included in source control](../Dependency%20Management/Dependency%20Management.md#checking-in-the-pods-folder). | ||
|
||
## Bundler | ||
|
||
Many developers naively use the built-in system Ruby to install gems such as Bundler using the `sudo gem install bundler` command. Unfortunately, this can lead to headaches due to the use of `sudo`. | ||
|
||
The better way to install Bundler is to get off the system Ruby and use a Ruby version manager to negate the need for `sudo` access when installing or executing gems. Follow the instructions in [Ruby Environment Setup](./Ruby%20Environment%20Setup.md) to install and setup [`rbenv`](https://github.com/rbenv/rbenv). | ||
|
||
Once your Ruby is properly setup, installing Bundler is as simple as: | ||
|
||
```bash | ||
gem install Bundler | ||
``` | ||
|
||
In order to use bundler in your repo you'll need to create a Gemfile to manage your dependencies. To create that file while in your repo's root directory use: | ||
|
||
```bash | ||
touch Gemfile | ||
``` | ||
|
||
Now you can simply add gems to this file using the text editor of your choice. | ||
|
||
To install all the gems in your Gemfile simply use the command: | ||
|
||
```bash | ||
bundle install | ||
``` | ||
|
||
For information on managing dependencies, both cocoapods and gems, see [Dependency Management.md](./Dependency%20Management/Dependency%20Management.md). | ||
|
||
## Cocoapods | ||
|
||
Many developers naively use the built-in system Ruby to install Cocoapods using the `sudo gem install cocoapods` command. Unfortunately, this can lead to headaches due to the use of `sudo`. | ||
Once Bundler is properly setup, adding Cocoapods as a dependency is as simple as adding it to your Gemfile: | ||
|
||
The better way to install Cocoapods is to get off the system Ruby and use a Ruby version manager to negate the need for `sudo` access when installing or executing gems. Follow the instructions in [Ruby Environment Setup](./Ruby%20Environment%20Setup.md) to install and setup [`rbenv`](https://github.com/rbenv/rbenv). | ||
``` | ||
gem 'cocoapods' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth mentioning the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely worth mentioning! We have info about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated Dependency Management to include information on Bundler as well as added a link to more information about dependency management in both the Cocoapods and Bundler sections here. |
||
``` | ||
|
||
Once your Ruby is properly setup, installing Cocoapods is as simple as: | ||
Then install it by using: | ||
|
||
```bash | ||
gem install cocoapods | ||
bundle install | ||
``` | ||
|
||
For information on managing dependencies, both cocoapods and gems, see [Dependency Management.md](./Dependency%20Management/Dependency%20Management.md). | ||
|
||
## Fastlane | ||
|
||
[Fastlane](https://fastlane.tools/) is our main build tool. Again, a Ruby version manager should be used so that a `sudo`-less installation of Fastlane can be achieved. | ||
[Fastlane](https://fastlane.tools/) is our main build tool. Again, Bundler should be used so that a `sudo`-less `non`global installation of Fastlane can be achieved. | ||
|
||
## Build Servers | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you think it's better to default to
bundle exec pod <command>
and have a note to removebundle exec
if Cocoapods is installed globally, or if we should default topod <command>
and have a note about prefixing it withbundle exec
if you're using Cocoapods installed with BundlerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually default to
bundle exec <command>
but I'm not sure if that's just me.