@@ -373,7 +373,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
373
373
return true ;
374
374
}
375
375
376
- const validBuildOutputData = platformData . getValidBuildOutputData ( { isForDevice : forDevice } ) ;
376
+ const validBuildOutputData = platformData . getValidBuildOutputData ( { isForDevice : forDevice , isReleaseBuild : buildConfig . release } ) ;
377
377
const packages = this . getApplicationPackages ( outputPath , validBuildOutputData ) ;
378
378
if ( packages . length === 0 ) {
379
379
return true ;
@@ -449,7 +449,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
449
449
450
450
await attachAwaitDetach ( constants . BUILD_OUTPUT_EVENT_NAME , platformData . platformProjectService , handler , platformData . platformProjectService . buildProject ( platformData . projectRoot , projectData , buildConfig ) ) ;
451
451
452
- const buildInfoFilePath = this . getBuildOutputPath ( platform , platformData , buildConfig ) ;
452
+ const buildInfoFilePath = this . getBuildOutputPath ( platform , platformData , { isForDevice : buildConfig . buildForDevice , isReleaseBuild : buildConfig . release , androidBundle : buildConfig . androidBundle } ) ;
453
453
this . saveBuildInfoFile ( platform , projectData . projectDir , buildInfoFilePath ) ;
454
454
455
455
this . $logger . out ( "Project successfully built." ) ;
@@ -468,15 +468,15 @@ export class PlatformService extends EventEmitter implements IPlatformService {
468
468
this . $fs . writeJson ( buildInfoFile , buildInfo ) ;
469
469
}
470
470
471
- public async shouldInstall ( device : Mobile . IDevice , projectData : IProjectData , release : IBuildConfig , outputPath ?: string ) : Promise < boolean > {
471
+ public async shouldInstall ( device : Mobile . IDevice , projectData : IProjectData , release : IRelease , outputPath ?: string ) : Promise < boolean > {
472
472
const platform = device . deviceInfo . platform ;
473
473
if ( ! ( await device . applicationManager . isApplicationInstalled ( projectData . projectIdentifiers [ platform . toLowerCase ( ) ] ) ) ) {
474
474
return true ;
475
475
}
476
476
477
477
const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
478
478
const deviceBuildInfo : IBuildInfo = await this . getDeviceBuildInfo ( device , projectData ) ;
479
- const localBuildInfo = this . getBuildInfo ( platform , platformData , { buildForDevice : ! device . isEmulator } , outputPath ) ;
479
+ const localBuildInfo = this . getBuildInfo ( platform , platformData , { isForDevice : ! device . isEmulator , isReleaseBuild : release . release } , outputPath ) ;
480
480
return ! localBuildInfo || ! deviceBuildInfo || deviceBuildInfo . buildTime !== localBuildInfo . buildTime ;
481
481
}
482
482
@@ -514,7 +514,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
514
514
const deviceFilePath = await this . getDeviceBuildInfoFilePath ( device , projectData ) ;
515
515
const options = buildConfig ;
516
516
options . buildForDevice = ! device . isEmulator ;
517
- const buildInfoFilePath = outputFilePath || this . getBuildOutputPath ( device . deviceInfo . platform , platformData , options ) ;
517
+ const buildInfoFilePath = outputFilePath || this . getBuildOutputPath ( device . deviceInfo . platform , platformData , { isForDevice : buildConfig . buildForDevice , isReleaseBuild : buildConfig . release , androidBundle : buildConfig . androidBundle } ) ;
518
518
const appIdentifier = projectData . projectIdentifiers [ platform ] ;
519
519
520
520
await device . fileSystem . putFile ( path . join ( buildInfoFilePath , buildInfoFileName ) , deviceFilePath , appIdentifier ) ;
@@ -611,9 +611,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
611
611
await this . $devicesService . execute ( action , this . getCanExecuteAction ( platform , runOptions ) ) ;
612
612
}
613
613
614
- private getBuildOutputPath ( platform : string , platformData : IPlatformData , options : IBuildForDevice ) : string {
614
+ private getBuildOutputPath ( platform : string , platformData : IPlatformData , options : IBuildOutputOptions ) : string {
615
+ if ( options . androidBundle ) {
616
+ return platformData . bundleBuildOutputPath ;
617
+ }
618
+
615
619
if ( platform . toLowerCase ( ) === this . $devicePlatformsConstants . iOS . toLowerCase ( ) ) {
616
- return options . buildForDevice ? platformData . deviceBuildOutputPath : platformData . emulatorBuildOutputPath ;
620
+ return options . isForDevice ? platformData . deviceBuildOutputPath : platformData . emulatorBuildOutputPath ;
617
621
}
618
622
619
623
return platformData . deviceBuildOutputPath ;
@@ -637,7 +641,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
637
641
}
638
642
}
639
643
640
- private getBuildInfo ( platform : string , platformData : IPlatformData , options : IBuildForDevice , buildOutputPath ?: string ) : IBuildInfo {
644
+ private getBuildInfo ( platform : string , platformData : IPlatformData , options : IBuildOutputOptions , buildOutputPath ?: string ) : IBuildInfo {
641
645
buildOutputPath = buildOutputPath || this . getBuildOutputPath ( platform , platformData , options ) ;
642
646
const buildInfoFile = path . join ( buildOutputPath , buildInfoFileName ) ;
643
647
if ( this . $fs . exists ( buildInfoFile ) ) {
@@ -899,11 +903,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
899
903
}
900
904
901
905
public getLatestApplicationPackageForDevice ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
902
- return this . getLatestApplicationPackage ( outputPath || platformData . deviceBuildOutputPath , platformData . getValidBuildOutputData ( { isForDevice : true , isReleaseBuild : buildConfig . release } ) ) ;
906
+ return this . getLatestApplicationPackage ( outputPath || platformData . deviceBuildOutputPath , platformData . getValidBuildOutputData ( { isForDevice : true , isReleaseBuild : buildConfig . release , androidBundle : buildConfig . androidBundle } ) ) ;
903
907
}
904
908
905
909
public getLatestApplicationPackageForEmulator ( platformData : IPlatformData , buildConfig : IBuildConfig , outputPath ?: string ) : IApplicationPackage {
906
- return this . getLatestApplicationPackage ( outputPath || platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath , platformData . getValidBuildOutputData ( { isForDevice : false , isReleaseBuild : buildConfig . release } ) ) ;
910
+ const buildOutputOptions : IBuildOutputOptions = { isForDevice : false , isReleaseBuild : buildConfig . release , androidBundle : buildConfig . androidBundle } ;
911
+ outputPath = outputPath || this . getBuildOutputPath ( platformData . normalizedPlatformName . toLowerCase ( ) , platformData , buildOutputOptions ) ;
912
+ return this . getLatestApplicationPackage ( outputPath || platformData . emulatorBuildOutputPath || platformData . deviceBuildOutputPath , platformData . getValidBuildOutputData ( buildOutputOptions ) ) ;
907
913
}
908
914
909
915
private async updatePlatform ( platform : string , version : string , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > {
0 commit comments