@@ -15,18 +15,24 @@ class IOSProjectService implements IPlatformProjectService {
15
15
constructor ( private $projectData : IProjectData ,
16
16
private $fs : IFileSystem ,
17
17
private $childProcess : IChildProcess ,
18
- private $errors : IErrors ) { }
18
+ private $errors : IErrors ,
19
+ private $iOSEmulatorServices : Mobile . IEmulatorPlatformServices ) { }
19
20
20
21
public get platformData ( ) : IPlatformData {
21
22
return {
22
23
frameworkPackageName : "tns-ios" ,
23
24
normalizedPlatformName : "iOS" ,
24
25
platformProjectService : this ,
26
+ emulatorServices : this . $iOSEmulatorServices ,
25
27
projectRoot : path . join ( this . $projectData . platformsDir , "ios" ) ,
26
- buildOutputPath : path . join ( this . $projectData . platformsDir , "ios" , "build" , "device" ) ,
27
- validPackageNames : [
28
+ deviceBuildOutputPath : path . join ( this . $projectData . platformsDir , "ios" , "build" , "device" ) ,
29
+ emulatorBuildOutputPath : path . join ( this . $projectData . platformsDir , "ios" , "build" , "emulator" ) ,
30
+ validPackageNamesForDevice : [
28
31
this . $projectData . projectName + ".ipa"
29
32
] ,
33
+ validPackageNamesForEmulator : [
34
+ this . $projectData . projectName + ".app"
35
+ ] ,
30
36
targetedOS : [ 'darwin' ]
31
37
} ;
32
38
}
@@ -117,18 +123,20 @@ class IOSProjectService implements IPlatformProjectService {
117
123
var childProcess = this . $childProcess . spawn ( "xcodebuild" , args , { cwd : options , stdio : 'inherit' } ) ;
118
124
this . $fs . futureFromEvent ( childProcess , "exit" ) . wait ( ) ;
119
125
120
- var buildOutputPath = path . join ( projectRoot , "build" , options . device ? "device" : "emulator" ) ;
126
+ if ( options . device ) {
127
+ var buildOutputPath = path . join ( projectRoot , "build" , options . device ? "device" : "emulator" ) ;
121
128
122
- // Produce ipa file
123
- var xcrunArgs = [
124
- "-sdk" , "iphoneos" ,
125
- "PackageApplication" ,
126
- "-v" , path . join ( buildOutputPath , this . $projectData . projectName + ".app" ) ,
127
- "-o" , path . join ( buildOutputPath , this . $projectData . projectName + ".ipa" )
128
- ] ;
129
+ // Produce ipa file
130
+ var xcrunArgs = [
131
+ "-sdk" , "iphoneos" ,
132
+ "PackageApplication" ,
133
+ "-v" , path . join ( buildOutputPath , this . $projectData . projectName + ".app" ) ,
134
+ "-o" , path . join ( buildOutputPath , this . $projectData . projectName + ".ipa" )
135
+ ] ;
129
136
130
- var childProcess = this . $childProcess . spawn ( "xcrun" , xcrunArgs , { cwd : options , stdio : 'inherit' } ) ;
131
- this . $fs . futureFromEvent ( childProcess , "exit" ) . wait ( ) ;
137
+ var childProcess = this . $childProcess . spawn ( "xcrun" , xcrunArgs , { cwd : options , stdio : 'inherit' } ) ;
138
+ this . $fs . futureFromEvent ( childProcess , "exit" ) . wait ( ) ;
139
+ }
132
140
} ) . future < void > ( ) ( ) ;
133
141
}
134
142
0 commit comments