Skip to content

Commit

Permalink
ci(react-native): run bundle install in test fixtures and pin xcodepr…
Browse files Browse the repository at this point in the history
…oj gem version
  • Loading branch information
yousif-bugsnag committed Oct 29, 2024
1 parent 2a4d46f commit 832f8b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bin/generate-react-native-fixture
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
}
}
4 changes: 4 additions & 0 deletions test/react-native/features/fixtures/app/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'cocoapods', '1.14.3'
gem 'xcodeproj', '< 1.26.0'

0 comments on commit 832f8b5

Please sign in to comment.