Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions Development Environment/Development Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,49 @@ 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
```

## 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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning the Gemfile.lock and it uses for keeping pinning to specific versions of Gems (and it should be committed to the repository)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely worth mentioning! We have info about the Podfile.lock in the Dependency Management section. Stuff about the Gemfile/Gemfile.lock might technically belong there, since it's how you manage your project's "meta" dependencies (e.g. Fastlane, Cocoapods, etc.). In any case, we should probably create some sort of link between these two sections.

Copy link
Author

Choose a reason for hiding this comment

The 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
```

## 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

Expand Down