@@ -12,39 +12,44 @@ import log from './utils/log'
12
12
13
13
const isProjectUsingPods = config . get ( 'usePods' )
14
14
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'
20
23
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 ( ' ' )
33
37
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
+ }
36
41
}
37
42
38
- export default function buildIOS ( ) {
43
+ export default function buildIOS ( isReactNativeBuild = false ) {
39
44
if ( IS_MACOS && IS_IOS ) {
40
- log ( '' , 'empty' ) // only for beautiful stdout
41
- log ( 'BUILD IOS DEFAULT' )
42
- buildIOSProject ( DEFAULT_TESTS_FOLDER )
43
-
44
45
if ( isProjectUsingPods ) {
45
46
log ( '' , 'empty' ) // only for beautiful stdout
46
47
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 )
48
53
}
49
54
50
55
log ( '' , 'empty' ) // only for beautiful stdout
0 commit comments