@@ -333,7 +333,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
333
333
334
334
const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
335
335
const forDevice = ! buildConfig || buildConfig . buildForDevice ;
336
- outputPath = outputPath || ( forDevice ? platformData . deviceBuildOutputPath ( buildConfig ) : platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath ( buildConfig ) ) ;
336
+ outputPath = outputPath || ( forDevice ? platformData . getDeviceBuildOutputPath ( buildConfig ) : platformData . emulatorBuildOutputPath || platformData . getDeviceBuildOutputPath ( buildConfig ) ) ;
337
337
if ( ! this . $fs . exists ( outputPath ) ) {
338
338
return true ;
339
339
}
@@ -433,15 +433,15 @@ export class PlatformService extends EventEmitter implements IPlatformService {
433
433
this . $fs . writeJson ( buildInfoFile , buildInfo ) ;
434
434
}
435
435
436
- public async shouldInstall ( device : Mobile . IDevice , projectData : IProjectData , release : boolean , outputPath ?: string ) : Promise < boolean > {
436
+ public async shouldInstall ( device : Mobile . IDevice , projectData : IProjectData , isRelease : IRelease , outputPath ?: string ) : Promise < boolean > {
437
437
const platform = device . deviceInfo . platform ;
438
438
if ( ! ( await device . applicationManager . isApplicationInstalled ( projectData . projectId ) ) ) {
439
439
return true ;
440
440
}
441
441
442
442
const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
443
443
const deviceBuildInfo : IBuildInfo = await this . getDeviceBuildInfo ( device , projectData ) ;
444
- const localBuildInfo = this . getBuildInfo ( platform , platformData , { buildForDevice : ! device . isEmulator , release : false } , outputPath ) ;
444
+ const localBuildInfo = this . getBuildInfo ( platform , platformData , { buildForDevice : ! device . isEmulator , release : isRelease . release } , outputPath ) ;
445
445
return ! localBuildInfo || ! deviceBuildInfo || deviceBuildInfo . buildTime !== localBuildInfo . buildTime ;
446
446
}
447
447
@@ -517,7 +517,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
517
517
this . $logger . out ( "Skipping package build. No changes detected on the native side. This will be fast!" ) ;
518
518
}
519
519
520
- if ( deployInfo . deployOptions . forceInstall || shouldBuild || ( await this . shouldInstall ( device , deployInfo . projectData , buildConfig . release ) ) ) {
520
+ if ( deployInfo . deployOptions . forceInstall || shouldBuild || ( await this . shouldInstall ( device , deployInfo . projectData , buildConfig ) ) ) {
521
521
await this . installApplication ( device , buildConfig , deployInfo . projectData ) ;
522
522
} else {
523
523
this . $logger . out ( "Skipping install." ) ;
@@ -552,12 +552,12 @@ export class PlatformService extends EventEmitter implements IPlatformService {
552
552
await this . $devicesService . execute ( action , this . getCanExecuteAction ( platform , runOptions ) ) ;
553
553
}
554
554
555
- private getBuildOutputPath ( platform : string , platformData : IPlatformData , options : IBuildForDevice ) : string {
555
+ private getBuildOutputPath ( platform : string , platformData : IPlatformData , options : IShouldInstall ) : string {
556
556
if ( platform . toLowerCase ( ) === this . $devicePlatformsConstants . iOS . toLowerCase ( ) ) {
557
- return options . buildForDevice ? platformData . deviceBuildOutputPath ( options ) : platformData . emulatorBuildOutputPath ;
557
+ return options . buildForDevice ? platformData . getDeviceBuildOutputPath ( options ) : platformData . emulatorBuildOutputPath ;
558
558
}
559
559
560
- return platformData . deviceBuildOutputPath ( options ) ;
560
+ return platformData . getDeviceBuildOutputPath ( options ) ;
561
561
}
562
562
563
563
private async getDeviceBuildInfoFilePath ( device : Mobile . IDevice , projectData : IProjectData ) : Promise < string > {
@@ -577,7 +577,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
577
577
}
578
578
}
579
579
580
- private getBuildInfo ( platform : string , platformData : IPlatformData , options : IBuildForDevice , buildOutputPath ?: string ) : IBuildInfo {
580
+ private getBuildInfo ( platform : string , platformData : IPlatformData , options : IShouldInstall , buildOutputPath ?: string ) : IBuildInfo {
581
581
buildOutputPath = buildOutputPath || this . getBuildOutputPath ( platform , platformData , options ) ;
582
582
const buildInfoFile = path . join ( buildOutputPath , buildInfoFileName ) ;
583
583
if ( this . $fs . exists ( buildInfoFile ) ) {
@@ -767,11 +767,11 @@ export class PlatformService extends EventEmitter implements IPlatformService {
767
767
}
768
768
769
769
public getLatestApplicationPackageForDevice ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
770
- return this . getLatestApplicationPackage ( outputPath || platformData . deviceBuildOutputPath ( buildConfig ) , platformData . getValidPackageNames ( { isForDevice : true , isReleaseBuild : buildConfig . release } ) ) ;
770
+ return this . getLatestApplicationPackage ( outputPath || platformData . getDeviceBuildOutputPath ( buildConfig ) , platformData . getValidPackageNames ( { isForDevice : true , isReleaseBuild : buildConfig . release } ) ) ;
771
771
}
772
772
773
773
public getLatestApplicationPackageForEmulator ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
774
- return this . getLatestApplicationPackage ( outputPath || platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath ( buildConfig ) , platformData . getValidPackageNames ( { isForDevice : false , isReleaseBuild : buildConfig . release } ) ) ;
774
+ return this . getLatestApplicationPackage ( outputPath || platformData . emulatorBuildOutputPath || platformData . getDeviceBuildOutputPath ( buildConfig ) , platformData . getValidPackageNames ( { isForDevice : false , isReleaseBuild : buildConfig . release } ) ) ;
775
775
}
776
776
777
777
private async updatePlatform ( platform : string , version : string , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > {
0 commit comments