From 9ac0500ddf27f39e888590f6785a3cffce556740 Mon Sep 17 00:00:00 2001 From: Lizzi Lindboe Date: Mon, 3 Jul 2023 16:14:58 -0700 Subject: [PATCH] Use bundle exec for pod install Should avoid churn in the Podfile.lock, and ensure consistent builds across environments. Added as an alias because it allows for more customization with flags in the future (such as the flag for enabling the New Architecture: https://reactnative.dev/docs/next/the-new-architecture/use-app-template#target-os) --- .github/workflows/platformDeploy.yml | 2 +- .github/workflows/testBuild.yml | 2 +- README.md | 5 ++++- ios/Podfile.lock | 2 +- package.json | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 8f8f80134e38..885d965ef0d8 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -165,7 +165,7 @@ jobs: with: timeout_minutes: 10 max_attempts: 5 - command: cd ios && pod install + command: cd ios && bundle exec pod install - name: Decrypt profile run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output chat_expensify_appstore.mobileprovision chat_expensify_appstore.mobileprovision.gpg diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index 246e31178564..30d20f10a7a3 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -148,7 +148,7 @@ jobs: with: timeout_minutes: 10 max_attempts: 5 - command: cd ios && pod install + command: cd ios && bundle exec pod install - name: Decrypt profile run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output chat_expensify_adhoc.mobileprovision chat_expensify_adhoc.mobileprovision.gpg diff --git a/README.md b/README.md index 88a3d7d4db60..b453a278b29f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,10 @@ In order to have more consistent builds, we use a strict `node` and `npm` versio ## Running the iOS app 📱 For an M1 Mac, read this [SO](https://stackoverflow.com/c/expensify/questions/11580) for installing cocoapods. -* To install the iOS dependencies, run: `npm install && cd ios/ && pod install && cd ..` +* Install project gems, including cocoapods, using bundler to ensure everyone uses the same versions. In the project root, run: `bundle install` + * If you get the error `Could not find 'bundler'`, install the bundler gem first: `gem install bundler` and try again. + * If you are using MacOS and get the error `Gem::FilePermissionError` when trying to install the bundler gem, you're likely using system Ruby, which requires administrator permission to modify. To get around this, install another version of Ruby with a version manager like [rbenv](https://github.com/rbenv/rbenv#installation). +* To install the iOS dependencies, run: `npm install && npm run pod-install` * If you are an Expensify employee and want to point the emulator to your local VM, follow [this](https://stackoverflow.com/c/expensify/questions/7699) * To run a on a **Development Simulator**: `npm run ios` * Changes applied to Javascript will be applied automatically, any changes to native code will require a recompile diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 41f6eadb9bd3..80ba0e0b5b79 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1141,4 +1141,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 4ed1c7b099741c82e2b0411b95f6468e72be6c76 -COCOAPODS: 1.12.1 +COCOAPODS: 1.11.3 diff --git a/package.json b/package.json index 220ada0e5100..67a196839041 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "clean": "npx react-native clean-project-auto", "android": "scripts/set-pusher-suffix.sh && npx react-native run-android --port=8083", "ios": "scripts/set-pusher-suffix.sh && npx react-native run-ios --port=8082", + "pod-install": "cd ios && bundle exec pod install", "ipad": "concurrently \"npx react-native run-ios --port=8082 --simulator=\"iPad Pro (12.9-inch) (4th generation)\"\"", "ipad-sm": "concurrently \"npx react-native run-ios --port=8082 --simulator=\"iPad Pro (9.7-inch)\"\"", "start": "npx react-native start",