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

Improve and clarify the dev setup process on a new machine #4643

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ jobs:

danger:
docker:
- image: cimg/ruby:3.1.2
- image: cimg/ruby:3.2.0
working_directory: ~/purchases-ios
shell: /bin/bash --login -o pipefail
steps:
Expand All @@ -1203,7 +1203,7 @@ jobs:

tag-release-branch:
docker:
- image: cimg/ruby:3.1.2
- image: cimg/ruby:3.2.0
working_directory: ~/purchases-ios
shell: /bin/bash --login -o pipefail
steps:
Expand Down
8 changes: 7 additions & 1 deletion Contributing/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ We use fastlane 🚀 for all our automation, including setting up out dev enviro
$brew install fastlane
```

Install gem dependencies

```bash
$bundle install --frozen
```

##### Run the setup lane.

```bash
$fastlane setup_dev
$bundle exec fastlane setup_dev
```

This installs [Homebrew](https://brew.sh/), and then [SwiftLint](https://github.com/realm/SwiftLint). After, it links in our pre-commit hook to run swiftlint. That saves you time so you don't have to wait for our CI to do it ⏱.
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "https://rubygems.org"

ruby '~> 3.2.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm this might force devs to update their ruby version... Was this needed for some dependency? I've been able to run fine from 3.1.2 with a clean clone, so not sure if it's needed. Were you finding errors in ruby 3.1.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other way around. I had ruby 3.4 installed by default and it was causing compatibility issues with some gems. I think it makes sense to fix the version to the same version as we're using on CI. (which was a mix of 3.2.0 and 3.1.2 before) I think it's ok to encourage devs to use a compatible ruby version since this is only applies to contributors, not for developers using purchase-ios in their apps.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok, I was just using 3.1.2 but I don't mind too much to update. Might want to give a heads up in #guild-sdks but looks good!


gem 'fastlane'
gem 'cocoapods'
gem 'cocoapods-trunk'
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-22
x86_64-linux

Expand Down
1 change: 1 addition & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ platform :ios do
else
UI.message("Linking pre-commit script 🔗")
Dir.chdir ".." do
Dir.mkdir(".git/hooks")
tonidero marked this conversation as resolved.
Show resolved Hide resolved
sh("ln -s -f ../../scripts/pre-commit.sh .git/hooks/pre-commit")
end
end
Expand Down