@@ -370,7 +370,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
370370 }
371371
372372 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
374373 if ( this . $projectChangesService . currentChanges . changesRequireBuild ) {
375374 return true ;
376375 }
@@ -587,13 +586,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
587586 appUpdater . cleanDestinationApp ( ) ;
588587 }
589588
590- public lastOutputPath ( platform : string , buildConfig : IBuildConfig , projectData : IProjectData ) : string {
589+ public lastOutputPath ( platform : string , buildConfig : IBuildConfig , projectData : IProjectData , outputPath ?: string ) : string {
591590 let packageFile : string ;
592591 let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
593592 if ( buildConfig . buildForDevice ) {
594- packageFile = this . getLatestApplicationPackageForDevice ( platformData , buildConfig ) . packageName ;
593+ packageFile = this . getLatestApplicationPackageForDevice ( platformData , buildConfig , outputPath ) . packageName ;
595594 } else {
596- packageFile = this . getLatestApplicationPackageForEmulator ( platformData , buildConfig ) . packageName ;
595+ packageFile = this . getLatestApplicationPackageForEmulator ( platformData , buildConfig , outputPath ) . packageName ;
597596 }
598597 if ( ! packageFile || ! this . $fs . exists ( packageFile ) ) {
599598 this . $errors . failWithoutHelp ( "Unable to find built application. Try 'tns build %s'." , platform ) ;
@@ -744,12 +743,12 @@ export class PlatformService extends EventEmitter implements IPlatformService {
744743 return packages [ 0 ] ;
745744 }
746745
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 } ) ) ;
749748 }
750749
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 } ) ) ;
753752 }
754753
755754 private async updatePlatform ( platform : string , version : string , platformTemplate : string , projectData : IProjectData , config : IAddPlatformCoreOptions ) : Promise < void > {
0 commit comments