2
2
3
3
import path = require( "path" ) ;
4
4
import shell = require( "shelljs" ) ;
5
+ import util = require( "util" ) ;
5
6
import constants = require( "./../constants" ) ;
6
7
import helpers = require( "./../common/helpers" ) ;
7
8
import options = require( "./../options" ) ;
@@ -35,6 +36,11 @@ class IOSProjectService implements IPlatformProjectService {
35
36
}
36
37
37
38
var xcodeBuildVersion = this . $childProcess . exec ( "xcodebuild -version | head -n 1 | sed -e 's/Xcode //'" ) . wait ( ) ;
39
+ var splitedXcodeBuildVersion = xcodeBuildVersion . split ( "." ) ;
40
+ if ( splitedXcodeBuildVersion . length === 3 ) {
41
+ xcodeBuildVersion = util . format ( "%s.%s" , splitedXcodeBuildVersion [ 0 ] , splitedXcodeBuildVersion [ 1 ] ) ;
42
+ }
43
+
38
44
if ( helpers . versionCompare ( xcodeBuildVersion , IOSProjectService . XCODEBUILD_MIN_VERSION ) < 0 ) {
39
45
this . $errors . fail ( "NativeScript can only run in Xcode version %s or greater" , IOSProjectService . XCODEBUILD_MIN_VERSION ) ;
40
46
}
@@ -81,7 +87,7 @@ class IOSProjectService implements IPlatformProjectService {
81
87
var basicArgs = [
82
88
"-project" , path . join ( projectRoot , this . $projectData . projectName + ".xcodeproj" ) ,
83
89
"-target" , this . $projectData . projectName ,
84
- "-configuration" , options . release ,
90
+ "-configuration" , options . release ? "Release" : "Debug" ,
85
91
"build"
86
92
] ;
87
93
var args : string [ ] = [ ] ;
@@ -90,8 +96,8 @@ class IOSProjectService implements IPlatformProjectService {
90
96
args = basicArgs . concat ( [
91
97
"-xcconfig" , path . join ( projectRoot , "build.xcconfig" ) ,
92
98
"-sdk" , "iphoneos" ,
93
- "ARCHS=\"armv7 armv7s arm64 \"" ,
94
- "VALID_ARCHS=\"armv7 armv7s arm64 \"" ,
99
+ "ARCHS=\"armv7\"" ,
100
+ "VALID_ARCHS=\"armv7\"" ,
95
101
"CONFIGURATION_BUILD_DIR=" + path . join ( projectRoot , "build" , "device" )
96
102
] ) ;
97
103
} else {
@@ -103,7 +109,9 @@ class IOSProjectService implements IPlatformProjectService {
103
109
] ) ;
104
110
}
105
111
106
- this . $childProcess . spawn ( "xcodebuild" , args , { cwd : options , stdio : 'inherit' } ) ;
112
+ var childProcess = this . $childProcess . spawn ( "xcodebuild" , args , { cwd : options , stdio : 'inherit' } ) ;
113
+ this . $fs . futureFromEvent ( childProcess , "exit" ) . wait ( ) ;
114
+
107
115
} ) . future < void > ( ) ( ) ;
108
116
}
109
117
0 commit comments