From bb1d6b7b5fd4d81bf0d1aa4d9b2f238b4e8947e2 Mon Sep 17 00:00:00 2001 From: efalkner Date: Sat, 11 Apr 2020 18:43:07 -0400 Subject: [PATCH] Update Cocoapods Provisioning (#440) Co-authored-by: Liz Falkner Co-authored-by: Tim Stirrat --- .github/workflows/build.yml | 14 +++++- .gitignore | 3 ++ dev_setup.sh | 10 ++++ ios/.bundle/config | 2 + ios/Gemfile | 5 ++ ios/Gemfile.lock | 94 +++++++++++++++++++++++++++++++++++++ package.json | 2 +- 7 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 ios/.bundle/config create mode 100644 ios/Gemfile create mode 100644 ios/Gemfile.lock diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b55eacc678..bec1a73617 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,19 @@ jobs: - run: yarn --frozen-lockfile - - run: gem install cocoapods + - name: Cache ruby gems + uses: actions/cache@v1 + with: + path: ios/vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Install ruby gems (including Cocoapods) + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + working-directory: ./ios - name: Cache CocoaPods uses: actions/cache@v1 diff --git a/.gitignore b/.gitignore index 1e6b84ddee..953bf9c63e 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,6 @@ app/locales/*_old.json yarn.lock .vscode/launch.json ios/Podfile.lock + +# Ruby gems +ios/vendor/bundle/* diff --git a/dev_setup.sh b/dev_setup.sh index efa809067d..6bec402f24 100755 --- a/dev_setup.sh +++ b/dev_setup.sh @@ -184,6 +184,16 @@ if ! found_exe android-studio ; then fi fi +# Install ruby bundler and cocoapods for iOS only, because they're only necessary for iOS development +# Mac OS comes with ruby out of the box. +if [[ "$OSTYPE" == "darwin"* ]] ; then + if ! gem list '^bundler$' -i --version 2.1.4; then + echo "${BLUE}Installing Ruby bundler for Cocoapod management...${RESET}" + sudo gem install bundler + echo "${GREEN}Bundler is installed!${RESET}" + fi +fi + # Need Watchman v4.9+ (watchman --version) if [[ "$OSTYPE" == "darwin"* ]] ; then diff --git a/ios/.bundle/config b/ios/.bundle/config new file mode 100644 index 0000000000..2369228816 --- /dev/null +++ b/ios/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_PATH: "vendor/bundle" diff --git a/ios/Gemfile b/ios/Gemfile new file mode 100644 index 0000000000..3104549a0c --- /dev/null +++ b/ios/Gemfile @@ -0,0 +1,5 @@ +ruby '~> 2.6.3' +source "https://rubygems.org" + +gem "bundler", "=2.1.4" +gem "cocoapods", "1.9.1" diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock new file mode 100644 index 0000000000..e1fb638d11 --- /dev/null +++ b/ios/Gemfile.lock @@ -0,0 +1,94 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.2) + activesupport (4.2.11.1) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + algoliasearch (1.27.1) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.0.3) + cocoapods (1.9.1) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.9.1) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 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.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.14.0, < 2.0) + cocoapods-core (1.9.1) + activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.3.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.1.0) + cocoapods-trunk (1.4.1) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.1.0) + colored2 (3.1.2) + concurrent-ruby (1.1.6) + escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) + ffi (1.12.2) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + json (2.3.0) + minitest (5.14.0) + molinillo (0.6.6) + nanaimo (0.2.6) + nap (1.1.0) + netrc (0.11.0) + ruby-macho (1.4.0) + thread_safe (0.3.6) + typhoeus (1.3.1) + ethon (>= 0.9.0) + tzinfo (1.2.7) + thread_safe (~> 0.1) + xcodeproj (1.16.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (= 2.1.4) + cocoapods (= 1.9.1) + +RUBY VERSION + ruby 2.6.3p62 + +BUNDLED WITH + 2.1.4 diff --git a/package.json b/package.json index e721fb8eac..f47f15a22e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('You must use Yarn to install, not NPM')\"", - "install:pod": "cd ios && pod install", + "install:pod": "cd ios && bundle install && bundle exec pod install", "postinstall": "patch-package; npx react-native-jetifier", "postversion": "react-native-version", "format:all": "prettier --write ./app/**/*.js",