File tree 5 files changed +25
-1
lines changed
5 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,12 @@ interface IPlatformProjectService {
163
163
* @returns {void }
164
164
*/
165
165
ensureConfigurationFileInAppResources ( ) : void ;
166
+
167
+ /**
168
+ * Removes build artifacts specific to the platform
169
+ * @returns {void }
170
+ */
171
+ cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void >
166
172
}
167
173
168
174
interface IAndroidProjectPropertiesManager {
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
410
410
return Future . fromResult ( ) ;
411
411
}
412
412
413
- private cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
413
+ public cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
414
414
return ( ( ) => {
415
415
options . unshift ( "clean" ) ;
416
416
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
653
653
this . platformData . configurationFileName
654
654
) ;
655
655
}
656
+
656
657
public ensureConfigurationFileInAppResources ( ) : void {
657
658
return null ;
658
659
}
659
660
661
+ public cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
662
+ return Future . fromResult ( ) ;
663
+ }
664
+
660
665
private mergeInfoPlists ( ) : IFuture < void > {
661
666
return ( ( ) => {
662
667
let projectDir = this . $projectData . projectDir ;
Original file line number Diff line number Diff line change @@ -217,6 +217,16 @@ export class PlatformService implements IPlatformService {
217
217
this . ensurePlatformInstalled ( platform ) . wait ( ) ;
218
218
let changesInfo = this . $projectChangesService . checkForChanges ( platform ) ;
219
219
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
+
220
230
this . preparePlatformCore ( platform , changesInfo ) . wait ( ) ;
221
231
this . $projectChangesService . savePrepareInfo ( platform ) ;
222
232
} else {
Original file line number Diff line number Diff line change @@ -338,6 +338,9 @@ export class PlatformProjectServiceStub implements IPlatformProjectService {
338
338
ensureConfigurationFileInAppResources ( ) : void {
339
339
return null ;
340
340
}
341
+ cleanProject ( projectRoot : string , options : string [ ] ) : IFuture < void > {
342
+ return Future . fromResult ( ) ;
343
+ }
341
344
}
342
345
343
346
export class ProjectDataService implements IProjectDataService {
You can’t perform that action at this time.
0 commit comments