@@ -41,6 +41,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
41
41
private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
42
42
private $projectTemplatesService : IProjectTemplatesService ,
43
43
private $xmlValidator : IXmlValidator ,
44
+ private $config : IConfiguration ,
44
45
private $npm : INodePackageManager ) {
45
46
super ( $fs , $projectData , $projectDataService ) ;
46
47
this . _androidProjectPropertiesManagers = Object . create ( null ) ;
@@ -298,6 +299,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
298
299
return this . $fs . exists ( path . join ( this . platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ) ;
299
300
}
300
301
302
+ public isPlatformBuilt ( projectRoot : string ) : IFuture < boolean > {
303
+ return this . $fs . exists ( path . join ( projectRoot , "build" , "outputs" , "apk" ) ) ;
304
+ }
305
+
301
306
public getFrameworkFilesExtensions ( ) : string [ ] {
302
307
return [ ".jar" , ".dat" ] ;
303
308
}
@@ -405,16 +410,18 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
405
410
}
406
411
407
412
public beforePrepareAllPlugins ( ) : IFuture < void > {
408
- let buildOptions = this . getBuildOptions ( ) ;
409
- buildOptions . unshift ( "clean" ) ;
413
+ if ( ! this . $config . debugLivesync ) {
414
+ let buildOptions = this . getBuildOptions ( ) ;
410
415
411
- let projectRoot = this . platformData . projectRoot ;
412
- let gradleBin = this . useGradleWrapper ( projectRoot ) ? path . join ( projectRoot , "gradlew" ) : "gradle" ;
413
- if ( this . $hostInfo . isWindows ) {
414
- gradleBin += ".bat" ;
415
- }
416
- this . spawn ( gradleBin , buildOptions , { stdio : "inherit" , cwd : this . platformData . projectRoot } ) . wait ( ) ;
416
+ buildOptions . unshift ( "clean" ) ;
417
417
418
+ let projectRoot = this . platformData . projectRoot ;
419
+ let gradleBin = this . useGradleWrapper ( projectRoot ) ? path . join ( projectRoot , "gradlew" ) : "gradle" ;
420
+ if ( this . $hostInfo . isWindows ) {
421
+ gradleBin += ".bat" ;
422
+ }
423
+ this . spawn ( gradleBin , buildOptions , { stdio : "inherit" , cwd : this . platformData . projectRoot } ) . wait ( ) ;
424
+ }
418
425
return Future . fromResult ( ) ;
419
426
}
420
427
0 commit comments