@@ -259,10 +259,13 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
259
259
// }
260
260
// }
261
261
262
+ this . $childProcess . on ( constants . BUILD_OUTPUT_EVENT_NAME , ( data : any ) => {
263
+ this . emit ( constants . BUILD_OUTPUT_EVENT_NAME , data ) ;
264
+ } ) ;
262
265
if ( buildConfig . buildForDevice ) {
263
266
await this . buildForDevice ( projectRoot , basicArgs , buildConfig , projectData ) ;
264
267
} else {
265
- await this . buildForSimulator ( projectRoot , basicArgs , buildConfig ) ;
268
+ await this . buildForSimulator ( projectRoot , basicArgs , projectData , buildConfig . buildOutputStdio ) ;
266
269
}
267
270
268
271
}
@@ -319,10 +322,14 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
319
322
}
320
323
321
324
// this.$logger.out("xcodebuild...");
322
- await this . $childProcess . spawnFromEvent ( "xcodebuild" , args , "exit" , { stdio : 'inherit' } ) ;
325
+ await this . $childProcess . spawnFromEvent ( "xcodebuild" ,
326
+ args ,
327
+ "exit" ,
328
+ { stdio : buildConfig . buildOutputStdio || "inherit" , cwd : this . getPlatformData ( projectData ) . projectRoot } ,
329
+ { emitOptions : { shouldEmit : true , eventName : constants . BUILD_OUTPUT_EVENT_NAME } , throwError : false } ) ;
323
330
// this.$logger.out("xcodebuild build succeded.");
324
331
325
- await this . createIpa ( projectRoot , projectData ) ;
332
+ await this . createIpa ( projectRoot , projectData , buildConfig . buildOutputStdio ) ;
326
333
}
327
334
328
335
private async setupSigningFromProvision ( projectRoot : string , projectData : IProjectData , provision ?: any ) : Promise < void > {
@@ -394,7 +401,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
394
401
}
395
402
}
396
403
397
- private async buildForSimulator ( projectRoot : string , args : string [ ] , buildConfig ?: IiOSBuildConfig ) : Promise < void > {
404
+ private async buildForSimulator ( projectRoot : string , args : string [ ] , projectData : IProjectData , buildOutputStdio ?: string ) : Promise < void > {
398
405
args = args . concat ( [
399
406
"-sdk" , "iphonesimulator" ,
400
407
"ARCHS=i386 x86_64" ,
@@ -404,10 +411,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
404
411
"CODE_SIGN_IDENTITY="
405
412
] ) ;
406
413
407
- await this . $childProcess . spawnFromEvent ( "xcodebuild" , args , "exit" , { stdio : 'inherit' } ) ;
414
+ await this . $childProcess . spawnFromEvent ( "xcodebuild" , args , "exit" ,
415
+ { stdio : buildOutputStdio || "inherit" , cwd : this . getPlatformData ( projectData ) . projectRoot } ,
416
+ { emitOptions : { shouldEmit : true , eventName : constants . BUILD_OUTPUT_EVENT_NAME } , throwError : false } ) ;
408
417
}
409
418
410
- private async createIpa ( projectRoot : string , projectData : IProjectData ) : Promise < void > {
419
+ private async createIpa ( projectRoot : string , projectData : IProjectData , buildOutputStdio ?: string ) : Promise < void > {
411
420
let buildOutputPath = path . join ( projectRoot , "build" , "device" ) ;
412
421
let xcrunArgs = [
413
422
"-sdk" , "iphoneos" ,
@@ -419,7 +428,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
419
428
xcrunArgs . push ( "-verbose" ) ;
420
429
// }
421
430
// this.$logger.out("Packaging project...");
422
- await this . $childProcess . spawnFromEvent ( "xcrun" , xcrunArgs , "exit" , { stdio : 'inherit' } ) ;
431
+ await this . $childProcess . spawnFromEvent ( "xcrun" , xcrunArgs , "exit" ,
432
+ { stdio : buildOutputStdio || "inherit" , cwd : this . getPlatformData ( projectData ) . projectRoot } ,
433
+ { emitOptions : { shouldEmit : true , eventName : constants . BUILD_OUTPUT_EVENT_NAME } , throwError : false } ) ;
423
434
// this.$logger.out("Project package succeeded.");
424
435
}
425
436
@@ -623,12 +634,12 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
623
634
624
635
private getInfoPlistPath ( projectData : IProjectData ) : string {
625
636
return path . join (
626
- projectData . projectDir ,
627
- constants . APP_FOLDER_NAME ,
628
- constants . APP_RESOURCES_FOLDER_NAME ,
629
- this . getPlatformData ( projectData ) . normalizedPlatformName ,
630
- this . getPlatformData ( projectData ) . configurationFileName
631
- ) ;
637
+ projectData . projectDir ,
638
+ constants . APP_FOLDER_NAME ,
639
+ constants . APP_RESOURCES_FOLDER_NAME ,
640
+ this . getPlatformData ( projectData ) . normalizedPlatformName ,
641
+ this . getPlatformData ( projectData ) . configurationFileName
642
+ ) ;
632
643
}
633
644
634
645
public ensureConfigurationFileInAppResources ( ) : void {
0 commit comments