From 23eeaab465c8b369744c7641d615d53044c18f56 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Fri, 29 Apr 2022 09:06:28 +0200 Subject: [PATCH] feat: use bundler to install Ruby Gems instead of installing them system-wide using root --- .github/scripts/setup.sh | 12 +++-- Documentation/Setup.md | 14 ++--- Gemfile | 6 +++ Gemfile.lock | 109 +++++++++++++++++++++++++++++++++++++++ update_localization.sh | 2 +- 5 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 0c2612d51..f5934be0c 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -1,9 +1,13 @@ #!/bin/bash -sudo gem install cocoapods-keys +# Install Ruby Bundler +sudo gem install bundler:2.3.11 + +# Install Ruby Gems +bundle install # stub keys. DO NOT use in production -pod keys set notification_endpoint "" -pod keys set notification_endpoint_debug "" +bundle exec pod keys set notification_endpoint "" +bundle exec pod keys set notification_endpoint_debug "" -pod install +bundle exec pod install diff --git a/Documentation/Setup.md b/Documentation/Setup.md index ede9d4862..b17a9db8e 100644 --- a/Documentation/Setup.md +++ b/Documentation/Setup.md @@ -12,12 +12,13 @@ Intell the latest version of Xcode from the App Store or Apple Developer Downloa This guide may not suit your machine and actually setup procedure may change in the future. Please file the issue or Pull Request if there are any problems. ## CocoaPods -The app use [CocoaPods]() and [CocoaPods-Keys](https://github.com/orta/cocoapods-keys). The M1 Mac needs virtual ruby env to workaround compatibility issues. +The app use [CocoaPods]() and [CocoaPods-Keys](https://github.com/orta/cocoapods-keys). Ruby Gems are managed through Bundler. The M1 Mac needs virtual ruby env to workaround compatibility issues. #### Intel Mac ```zsh -sudo gem install cocoapods cocoapods-keys +sudo gem install bundler +bundle install ``` #### M1 Mac @@ -40,18 +41,19 @@ rbenv global 3.0.3 ruby --version # > ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [arm64-darwin21] -sudo gem install cocoapods cocoapods-keys +sudo gem install bundler +bundle install ``` ## Bootstrap ```zsh # make a clean build -sudo gem install cocoapods-clean -pod clean +bundle install +bundle exec pod clean # make install -pod install --repo-update +bundle exec pod install --repo-update # open workspace open Mastodon.xcworkspace diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..48aae3d82 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "cocoapods" +gem "cocoapods-clean" +gem "cocoapods-keys" + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..b27a44a97 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,109 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.5) + rexml + RubyInline (3.12.5) + ZenTest (~> 4.3) + ZenTest (4.12.1) + activesupport (6.1.5.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.1.0) + cocoapods (1.11.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.11.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 1.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + cocoapods-clean (0.0.1) + cocoapods-core (1.11.3) + activesupport (>= 5.0, < 7) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.6.3) + cocoapods-keys (2.2.1) + dotenv + osx_keychain + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.1.10) + dotenv (2.7.6) + escape (0.0.4) + ethon (0.15.0) + ffi (>= 1.15.0) + ffi (1.15.5) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.10.0) + concurrent-ruby (~> 1.0) + json (2.6.1) + minitest (5.15.0) + molinillo (0.8.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + osx_keychain (1.0.2) + RubyInline (~> 3) + public_suffix (4.0.7) + rexml (3.2.5) + ruby-macho (2.5.1) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + xcodeproj (1.21.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + zeitwerk (2.5.4) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods + cocoapods-clean + cocoapods-keys + +BUNDLED WITH + 2.3.11 diff --git a/update_localization.sh b/update_localization.sh index b234cd933..09cfc21d6 100755 --- a/update_localization.sh +++ b/update_localization.sh @@ -21,7 +21,7 @@ echo "${PODS_ROOT}/SwiftGen/bin/swiftgen" if [[ -f "${PODS_ROOT}/SwiftGen/bin/swiftgen" ]] then "${PODS_ROOT}/SwiftGen/bin/swiftgen" else - echo "Run 'pod install' or update your CocoaPods installation." + echo "Run 'bundle exec pod install' or update your CocoaPods installation." fi #task 4 clean temp file