File tree Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,12 @@ interface IPlatformProjectService {
163163 * @returns {void }
164164 */
165165 ensureConfigurationFileInAppResources ( ) : void ;
166+
167+ /**
168+ * Removes build artifacts specific to the platform
169+ * @returns {void }
170+ */
171+ cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void >
166172}
167173
168174interface IAndroidProjectPropertiesManager {
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
410410 return Future . fromResult ( ) ;
411411 }
412412
413- private cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
413+ public cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
414414 return ( ( ) => {
415415 options . unshift ( "clean" ) ;
416416
Original file line number Diff line number Diff line change @@ -653,10 +653,15 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
653653 this . platformData . configurationFileName
654654 ) ;
655655 }
656+
656657 public ensureConfigurationFileInAppResources ( ) : void {
657658 return null ;
658659 }
659660
661+ public cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
662+ return Future . fromResult ( ) ;
663+ }
664+
660665 private mergeInfoPlists ( ) : IFuture < void > {
661666 return ( ( ) => {
662667 let projectDir = this . $projectData . projectDir ;
Original file line number Diff line number Diff line change @@ -217,6 +217,16 @@ export class PlatformService implements IPlatformService {
217217 this . ensurePlatformInstalled ( platform ) . wait ( ) ;
218218 let changesInfo = this . $projectChangesService . checkForChanges ( platform ) ;
219219 if ( changesInfo . hasChanges ) {
220+ // android build artifacts need to be cleaned up when switching from release to debug builds
221+ if ( platform . toLowerCase ( ) === "android" ) {
222+ let previousPrepareInfo = this . $projectChangesService . getPrepareInfo ( platform ) ;
223+ // clean up prepared plugins when not building for release
224+ if ( previousPrepareInfo && previousPrepareInfo . release !== this . $options . release ) {
225+ let platformData = this . $platformsData . getPlatformData ( platform ) ;
226+ platformData . platformProjectService . cleanProject ( platformData . projectRoot , [ ] ) . wait ( ) ;
227+ }
228+ }
229+
220230 this . preparePlatformCore ( platform , changesInfo ) . wait ( ) ;
221231 this . $projectChangesService . savePrepareInfo ( platform ) ;
222232 } else {
Original file line number Diff line number Diff line change @@ -338,6 +338,9 @@ export class PlatformProjectServiceStub implements IPlatformProjectService {
338338 ensureConfigurationFileInAppResources ( ) : void {
339339 return null ;
340340 }
341+ cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
342+ return Future . fromResult ( ) ;
343+ }
341344}
342345
343346export class ProjectDataService implements IProjectDataService {
You can’t perform that action at this time.
0 commit comments