@@ -370,7 +370,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
370
370
}
371
371
372
372
public async shouldBuild ( platform : string , projectData : IProjectData , buildConfig : IBuildConfig , outputPath ?: string ) : Promise < boolean > {
373
- //TODO: shouldBuild - issue with outputPath - we do not have always the built dir locally
374
373
if ( this . $projectChangesService . currentChanges . changesRequireBuild ) {
375
374
return true ;
376
375
}
@@ -587,13 +586,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
587
586
appUpdater . cleanDestinationApp ( ) ;
588
587
}
589
588
590
- public lastOutputPath ( platform : string , buildConfig : IBuildConfig , projectData : IProjectData ) : string {
589
+ public lastOutputPath ( platform : string , buildConfig : IBuildConfig , projectData : IProjectData , outputPath ?: string ) : string {
591
590
let packageFile : string ;
592
591
let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
593
592
if ( buildConfig . buildForDevice ) {
594
- packageFile = this . getLatestApplicationPackageForDevice ( platformData , buildConfig ) . packageName ;
593
+ packageFile = this . getLatestApplicationPackageForDevice ( platformData , buildConfig , outputPath ) . packageName ;
595
594
} else {
596
- packageFile = this . getLatestApplicationPackageForEmulator ( platformData , buildConfig ) . packageName ;
595
+ packageFile = this . getLatestApplicationPackageForEmulator ( platformData , buildConfig , outputPath ) . packageName ;
597
596
}
598
597
if ( ! packageFile || ! this . $fs . exists ( packageFile ) ) {
599
598
this . $errors . failWithoutHelp ( "Unable to find built application. Try 'tns build %s'." , platform ) ;
@@ -744,12 +743,12 @@ export class PlatformService extends EventEmitter implements IPlatformService {
744
743
return packages [ 0 ] ;
745
744
}
746
745
747
- public getLatestApplicationPackageForDevice ( platformData : IPlatformData , buildConfig : IBuildConfig ) : IApplicationPackage {
748
- return this . getLatestApplicationPackage ( platformData . deviceBuildOutputPath , platformData . getValidPackageNames ( { isForDevice : true , isReleaseBuild : buildConfig . release } ) ) ;
746
+ public getLatestApplicationPackageForDevice ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
747
+ return this . getLatestApplicationPackage ( outputPath || platformData . deviceBuildOutputPath , platformData . getValidPackageNames ( { isForDevice : true , isReleaseBuild : buildConfig . release } ) ) ;
749
748
}
750
749
751
- public getLatestApplicationPackageForEmulator ( platformData : IPlatformData , buildConfig : IBuildConfig ) : IApplicationPackage {
752
- return this . getLatestApplicationPackage ( platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath , platformData . getValidPackageNames ( { isForDevice : false , isReleaseBuild : buildConfig . release } ) ) ;
750
+ public getLatestApplicationPackageForEmulator ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
751
+ return this . getLatestApplicationPackage ( outputPath || platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath , platformData . getValidPackageNames ( { isForDevice : false , isReleaseBuild : buildConfig . release } ) ) ;
753
752
}
754
753
755
754
private async updatePlatform ( platform : string , version : string , platformTemplate : string , projectData : IProjectData , config : IAddPlatformCoreOptions ) : Promise < void > {
0 commit comments