99 private $config : IConfiguration ,
1010 private $usbLiveSyncService : ILiveSyncService ,
1111 protected $platformService : IPlatformService ,
12+ protected $projectData : IProjectData ,
1213 protected $options : IOptions ,
13- protected $platformsData : IPlatformsData ) { }
14+ protected $platformsData : IPlatformsData ) {
15+ this . $projectData . initializeProjectData ( ) ;
16+ }
1417
1518 public async execute ( args : string [ ] ) : Promise < void > {
1619 if ( this . $options . start ) {
17- return this . debugService . debug ( ) ;
20+ return this . debugService . debug ( this . $projectData ) ;
1821 }
1922
20- await this . $platformService . deployPlatform ( this . $devicesService . platform ) ;
23+ const appFilesUpdaterOptions : IAppFilesUpdaterOptions = { bundle : this . $options . bundle , release : this . $options . release } ;
24+ const deployOptions : IDeployPlatformOptions = {
25+ clean : this . $options . clean ,
26+ device : this . $options . device ,
27+ emulator : this . $options . emulator ,
28+ platformTemplate : this . $options . platformTemplate ,
29+ projectDir : this . $options . path ,
30+ release : this . $options . release
31+ } ;
32+ await this . $platformService . deployPlatform ( this . $devicesService . platform , appFilesUpdaterOptions , deployOptions , this . $projectData , this . $options . provision ) ;
2133 this . $config . debugLivesync = true ;
2234 let applicationReloadAction = async ( deviceAppData : Mobile . IDeviceAppData ) : Promise < void > => {
2335 let projectData : IProjectData = this . $injector . resolve ( "projectData" ) ;
3143
3244 await deviceAppData . device . applicationManager . stopApplication ( applicationId ) ;
3345
34- await this . debugService . debug ( ) ;
46+ await this . debugService . debug ( this . $projectData ) ;
3547 } ;
36- return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , applicationReloadAction ) ;
48+ return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , this . $projectData , applicationReloadAction ) ;
3749 }
3850
3951 public async canExecute ( args : string [ ] ) : Promise < boolean > {
@@ -64,13 +76,14 @@ export class DebugIOSCommand extends DebugPlatformCommand {
6476 $usbLiveSyncService : ILiveSyncService ,
6577 $platformService : IPlatformService ,
6678 $options : IOptions ,
79+ $projectData : IProjectData ,
6780 $platformsData : IPlatformsData ) {
6881
69- super ( $iOSDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
82+ super ( $iOSDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $projectData , $ options, $platformsData ) ;
7083 }
7184
7285 public async canExecute ( args : string [ ] ) : Promise < boolean > {
73- return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
86+ return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $ platformsData. availablePlatforms . iOS ) ;
7487 }
7588}
7689
@@ -86,13 +99,14 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
8699 $usbLiveSyncService : ILiveSyncService ,
87100 $platformService : IPlatformService ,
88101 $options : IOptions ,
102+ $projectData : IProjectData ,
89103 $platformsData : IPlatformsData ) {
90104
91- super ( $androidDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
105+ super ( $androidDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $projectData , $ options, $platformsData ) ;
92106 }
93107
94108 public async canExecute ( args : string [ ] ) : Promise < boolean > {
95- return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . Android ) ;
109+ return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $ platformsData. availablePlatforms . Android ) ;
96110 }
97111}
98112
0 commit comments