@@ -194,6 +194,10 @@ export class PlatformService extends EventEmitter implements IPlatformService {
194
194
const requiresNativePrepare = ( ! platformInfo . nativePrepare || ! platformInfo . nativePrepare . skipNativePrepare ) && changesInfo . nativePlatformStatus === constants . NativePlatformStatus . requiresPrepare ;
195
195
196
196
if ( changesInfo . hasChanges || platformInfo . appFilesUpdaterOptions . bundle || requiresNativePrepare ) {
197
+ if ( changesInfo . bundleChanged ) {
198
+ await this . cleanDestinationApp ( platformInfo ) ;
199
+ }
200
+
197
201
await this . preparePlatformCore (
198
202
platformInfo . platform ,
199
203
platformInfo . appFilesUpdaterOptions ,
@@ -553,13 +557,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
553
557
return null ;
554
558
}
555
559
556
- public async cleanDestinationApp ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > {
557
- await this . ensurePlatformInstalled ( platform , platformTemplate , projectData , config ) ;
560
+ public async cleanDestinationApp ( platformInfo : IPreparePlatformInfo ) : Promise < void > {
561
+ await this . ensurePlatformInstalled ( platformInfo . platform , platformInfo . platformTemplate , platformInfo . projectData , platformInfo . config ) ;
558
562
559
- const appSourceDirectoryPath = path . join ( projectData . projectDir , constants . APP_FOLDER_NAME ) ;
560
- const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
563
+ const appSourceDirectoryPath = path . join ( platformInfo . projectData . projectDir , constants . APP_FOLDER_NAME ) ;
564
+ const platformData = this . $platformsData . getPlatformData ( platformInfo . platform , platformInfo . projectData ) ;
561
565
const appDestinationDirectoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
562
- const appUpdater = new AppFilesUpdater ( appSourceDirectoryPath , appDestinationDirectoryPath , appFilesUpdaterOptions , this . $fs ) ;
566
+ const appUpdater = new AppFilesUpdater ( appSourceDirectoryPath , appDestinationDirectoryPath , platformInfo . appFilesUpdaterOptions , this . $fs ) ;
563
567
appUpdater . cleanDestinationApp ( ) ;
564
568
}
565
569
0 commit comments