@@ -15,18 +15,24 @@ class IOSProjectService implements IPlatformProjectService {
1515 constructor ( private $projectData : IProjectData ,
1616 private $fs : IFileSystem ,
1717 private $childProcess : IChildProcess ,
18- private $errors : IErrors ) { }
18+ private $errors : IErrors ,
19+ private $iOSEmulatorServices : Mobile . IEmulatorPlatformServices ) { }
1920
2021 public get platformData ( ) : IPlatformData {
2122 return {
2223 frameworkPackageName : "tns-ios" ,
2324 normalizedPlatformName : "iOS" ,
2425 platformProjectService : this ,
26+ emulatorServices : this . $iOSEmulatorServices ,
2527 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 : [
2831 this . $projectData . projectName + ".ipa"
2932 ] ,
33+ validPackageNamesForEmulator : [
34+ this . $projectData . projectName + ".app"
35+ ] ,
3036 targetedOS : [ 'darwin' ]
3137 } ;
3238 }
@@ -117,18 +123,20 @@ class IOSProjectService implements IPlatformProjectService {
117123 var childProcess = this . $childProcess . spawn ( "xcodebuild" , args , { cwd : options , stdio : 'inherit' } ) ;
118124 this . $fs . futureFromEvent ( childProcess , "exit" ) . wait ( ) ;
119125
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" ) ;
121128
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+ ] ;
129136
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+ }
132140 } ) . future < void > ( ) ( ) ;
133141 }
134142
0 commit comments