@@ -12,39 +12,44 @@ import log from './utils/log'
1212
1313const isProjectUsingPods = config . get ( 'usePods' )
1414
15- function buildIOSProject ( projectPath ) {
16- const iosFolder = path . resolve ( projectPath , 'ios' )
17- const whatToBuild = isProjectUsingPods
18- ? '-workspace example.xcworkspace'
19- : '-project example.xcodeproj'
15+ function buildIOSProject ( projectPath , isReactNativeBuild ) {
16+ if ( isReactNativeBuild ) {
17+ run ( 'react-native run-ios --simulator="iPhone 6" --configuration=release' , projectPath )
18+ } else {
19+ const iosFolder = path . resolve ( projectPath , 'ios' )
20+ const whatToBuild = isProjectUsingPods
21+ ? '-workspace example.xcworkspace'
22+ : '-project example.xcodeproj'
2023
21- log ( 'RUN RELEASE BUILD' , 'info' )
22- const xcodebuildArguments = [
23- 'build' ,
24- whatToBuild ,
25- '-scheme example' ,
26- '-configuration Release' ,
27- '-sdk iphonesimulator' ,
28- "-destination 'platform=iOS Simulator,name=iPhone 6'" ,
29- '-derivedDataPath build' ,
30- 'ONLY_ACTIVE_ARCH=NO' ,
31- "OTHER_LDFLAGS='$(inherited) -ObjC -lc++'" ,
32- ] . join ( ' ' )
24+ log ( 'RUN RELEASE BUILD' , 'info' )
25+ const xcodebuildArguments = [
26+ 'build' ,
27+ whatToBuild ,
28+ '-scheme example' ,
29+ '-configuration Release' ,
30+ '-sdk iphonesimulator' ,
31+ "-destination 'platform=iOS Simulator,name=iPhone 6'" ,
32+ '-derivedDataPath build' ,
33+ 'ONLY_ACTIVE_ARCH=NO' ,
34+ '-UseModernBuildSystem=NO' ,
35+ "OTHER_LDFLAGS='$(inherited) -ObjC -lc++'" ,
36+ ] . join ( ' ' )
3337
34- const formatter = commandExists . sync ( 'xcpretty' ) ? '| xcpretty' : ''
35- run ( `xcodebuild ${ xcodebuildArguments } ${ formatter } ` , iosFolder )
38+ const formatter = commandExists . sync ( 'xcpretty' ) ? '| xcpretty' : ''
39+ run ( `xcodebuild ${ xcodebuildArguments } ${ formatter } ` , iosFolder )
40+ }
3641}
3742
38- export default function buildIOS ( ) {
43+ export default function buildIOS ( isReactNativeBuild = false ) {
3944 if ( IS_MACOS && IS_IOS ) {
40- log ( '' , 'empty' ) // only for beautiful stdout
41- log ( 'BUILD IOS DEFAULT' )
42- buildIOSProject ( DEFAULT_TESTS_FOLDER )
43-
4445 if ( isProjectUsingPods ) {
4546 log ( '' , 'empty' ) // only for beautiful stdout
4647 log ( 'BUILD IOS PODSPEC' )
47- buildIOSProject ( PODSPEC_TESTS_FOLDER )
48+ buildIOSProject ( PODSPEC_TESTS_FOLDER , isReactNativeBuild )
49+ } else {
50+ log ( '' , 'empty' ) // only for beautiful stdout
51+ log ( 'BUILD IOS DEFAULT' )
52+ buildIOSProject ( DEFAULT_TESTS_FOLDER , isReactNativeBuild )
4853 }
4954
5055 log ( '' , 'empty' ) // only for beautiful stdout
0 commit comments