From 832f8b59d0a7d926ca80194f9948be8b1cf95283 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Tue, 29 Oct 2024 14:16:17 +0000 Subject: [PATCH] ci(react-native): run bundle install in test fixtures and pin xcodeproj gem version --- bin/generate-react-native-fixture | 14 +++++++++++++- test/react-native/features/fixtures/app/Gemfile | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/react-native/features/fixtures/app/Gemfile diff --git a/bin/generate-react-native-fixture b/bin/generate-react-native-fixture index 82fe785cf..bc2dd9d5a 100755 --- a/bin/generate-react-native-fixture +++ b/bin/generate-react-native-fixture @@ -127,7 +127,8 @@ if (process.env.BUILD_IOS === 'true' || process.env.BUILD_IOS === '1') { fs.rmSync(`${fixtureDir}/reactnative.xcarchive`, { recursive: true, force: true }) // install pods - execFileSync('pod', ['install'], { cwd: `${fixtureDir}/ios`, stdio: 'inherit' }) + execFileSync('bundle', ['install'], { cwd: `${fixtureDir}/ios`, stdio: 'inherit' }) + execFileSync('bundle', ['exec', 'pod', 'install'], { cwd: `${fixtureDir}/ios`, stdio: 'inherit' }) // build the iOS app const archiveArgs = [ @@ -222,6 +223,9 @@ function configureRN064Fixture(fixtureDir) { let yogaCpp = fs.readFileSync(yogaCppPath, 'utf8') yogaCpp = yogaCpp.replace('node->getLayout().hadOverflow() |', 'node->getLayout().hadOverflow() ||') fs.writeFileSync(yogaCppPath, yogaCpp) + + // copy gemfile + fs.copyFileSync(resolve(ROOT_DIR, 'test/react-native/features/fixtures/app/Gemfile'), resolve(fixtureDir, 'Gemfile')) } /** Pack and install local packages from this repo */ @@ -312,4 +316,12 @@ function replaceGeneratedFixtureFiles() { } fs.writeFileSync(`${fixtureDir}/ios/Podfile`, podfileContents) + + // pin xcodeproj version to < 1.26.0 + const gemfilePath = resolve(fixtureDir, 'Gemfile') + if (fs.existsSync(gemfilePath)) { + let gemfileContents = fs.readFileSync(gemfilePath, 'utf8') + gemfileContents += `\ngem 'xcodeproj', '< 1.26.0'` + fs.writeFileSync(gemfilePath, gemfileContents) + } } diff --git a/test/react-native/features/fixtures/app/Gemfile b/test/react-native/features/fixtures/app/Gemfile new file mode 100644 index 000000000..0d8655af4 --- /dev/null +++ b/test/react-native/features/fixtures/app/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'cocoapods', '1.14.3' +gem 'xcodeproj', '< 1.26.0'