@@ -59,10 +59,10 @@ const DEPENDENCIES = [
5959 `react-native-file-access@${ reactNativeFileAccessVersion } `
6060]
6161
62- const reactNavigationVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '6.1.18' : 'latest '
63- const reactNavigationNativeStackVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '6.11.0' : 'latest '
64- const reactNativeScreensVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '3.14.0' : 'latest '
65- const reactNativeSafeAreaContextVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '4.1.0' : 'latest '
62+ const reactNavigationVersion = '6.1.18'
63+ const reactNavigationNativeStackVersion = '6.11.0'
64+ const reactNativeScreensVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '3.14.0' : '3.35.0 '
65+ const reactNativeSafeAreaContextVersion = parseFloat ( reactNativeVersion ) <= 0.64 ? '4.1.0' : '4.14.0 '
6666const REACT_NAVIGATION_DEPENDENCIES = [
6767 `@react-navigation/native@${ reactNavigationVersion } ` ,
6868 `@react-navigation/native-stack@${ reactNavigationNativeStackVersion } ` ,
@@ -98,7 +98,7 @@ if (!process.env.SKIP_GENERATE_FIXTURE) {
9898 }
9999
100100 // create the test fixture
101- const RNInitArgs = [ '@react-native-community/cli@latest' , 'init' , 'reactnative' , '--package-name' , 'com.bugsnag.fixtures.reactnative.performance' , '--directory' , fixtureDir , '--version' , reactNativeVersion , '--npm' , '--skip-install' ]
101+ const RNInitArgs = [ '@react-native-community/cli@latest' , 'init' , 'reactnative' , '--package-name' , 'com.bugsnag.fixtures.reactnative.performance' , '--directory' , fixtureDir , '--version' , reactNativeVersion , '--pm' , ' npm', '--skip-install' ]
102102 execFileSync ( 'npx' , RNInitArgs , { stdio : 'inherit' } )
103103
104104 replaceGeneratedFixtureFiles ( )
@@ -127,7 +127,8 @@ if (process.env.BUILD_IOS === 'true' || process.env.BUILD_IOS === '1') {
127127 fs . rmSync ( `${ fixtureDir } /reactnative.xcarchive` , { recursive : true , force : true } )
128128
129129 // install pods
130- execFileSync ( 'pod' , [ 'install' ] , { cwd : `${ fixtureDir } /ios` , stdio : 'inherit' } )
130+ execFileSync ( 'bundle' , [ 'install' ] , { cwd : `${ fixtureDir } /ios` , stdio : 'inherit' } )
131+ execFileSync ( 'bundle' , [ 'exec' , 'pod' , 'install' ] , { cwd : `${ fixtureDir } /ios` , stdio : 'inherit' } )
131132
132133 // build the iOS app
133134 const archiveArgs = [
@@ -222,6 +223,9 @@ function configureRN064Fixture(fixtureDir) {
222223 let yogaCpp = fs . readFileSync ( yogaCppPath , 'utf8' )
223224 yogaCpp = yogaCpp . replace ( 'node->getLayout().hadOverflow() |' , 'node->getLayout().hadOverflow() ||' )
224225 fs . writeFileSync ( yogaCppPath , yogaCpp )
226+
227+ // copy gemfile
228+ fs . copyFileSync ( resolve ( ROOT_DIR , 'test/react-native/features/fixtures/app/Gemfile' ) , resolve ( fixtureDir , 'Gemfile' ) )
225229}
226230
227231/** Pack and install local packages from this repo */
@@ -302,4 +306,22 @@ function replaceGeneratedFixtureFiles() {
302306 resolve ( fixtureDir , `android/app/src/main/java/com/bugsnag/fixtures/reactnative/performance/MainActivity.${ fileExtension } ` )
303307 )
304308 }
309+
310+ // disable Flipper
311+ let podfileContents = fs . readFileSync ( `${ fixtureDir } /ios/Podfile` , 'utf8' )
312+ if ( podfileContents . includes ( 'use_flipper!' ) ) {
313+ podfileContents = podfileContents . replace ( / u s e _ f l i p p e r ! / , '# use_flipper!' )
314+ } else if ( podfileContents . includes ( ':flipper_configuration' ) ) {
315+ podfileContents = podfileContents . replace ( / : f l i p p e r _ c o n f i g u r a t i o n / , '# :flipper_configuration' )
316+ }
317+
318+ fs . writeFileSync ( `${ fixtureDir } /ios/Podfile` , podfileContents )
319+
320+ // pin xcodeproj version to < 1.26.0
321+ const gemfilePath = resolve ( fixtureDir , 'Gemfile' )
322+ if ( fs . existsSync ( gemfilePath ) ) {
323+ let gemfileContents = fs . readFileSync ( gemfilePath , 'utf8' )
324+ gemfileContents += `\ngem 'xcodeproj', '< 1.26.0'`
325+ fs . writeFileSync ( gemfilePath , gemfileContents )
326+ }
305327}
0 commit comments