9
9
private $config : IConfiguration ,
10
10
private $usbLiveSyncService : ILiveSyncService ,
11
11
protected $platformService : IPlatformService ,
12
+ protected $projectData : IProjectData ,
12
13
protected $options : IOptions ,
13
- protected $platformsData : IPlatformsData ) { }
14
+ protected $platformsData : IPlatformsData ) {
15
+ this . $projectData . initializeProjectData ( ) ;
16
+ }
14
17
15
18
public async execute ( args : string [ ] ) : Promise < void > {
16
19
if ( this . $options . start ) {
17
- return this . debugService . debug ( ) ;
20
+ return this . debugService . debug ( this . $projectData ) ;
18
21
}
19
22
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 ) ;
21
33
this . $config . debugLivesync = true ;
22
34
let applicationReloadAction = async ( deviceAppData : Mobile . IDeviceAppData ) : Promise < void > => {
23
35
let projectData : IProjectData = this . $injector . resolve ( "projectData" ) ;
31
43
32
44
await deviceAppData . device . applicationManager . stopApplication ( applicationId ) ;
33
45
34
- await this . debugService . debug ( ) ;
46
+ await this . debugService . debug ( this . $projectData ) ;
35
47
} ;
36
- return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , applicationReloadAction ) ;
48
+ return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , this . $projectData , applicationReloadAction ) ;
37
49
}
38
50
39
51
public async canExecute ( args : string [ ] ) : Promise < boolean > {
@@ -64,13 +76,14 @@ export class DebugIOSCommand extends DebugPlatformCommand {
64
76
$usbLiveSyncService : ILiveSyncService ,
65
77
$platformService : IPlatformService ,
66
78
$options : IOptions ,
79
+ $projectData : IProjectData ,
67
80
$platformsData : IPlatformsData ) {
68
81
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 ) ;
70
83
}
71
84
72
85
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 ) ;
74
87
}
75
88
}
76
89
@@ -86,13 +99,14 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
86
99
$usbLiveSyncService : ILiveSyncService ,
87
100
$platformService : IPlatformService ,
88
101
$options : IOptions ,
102
+ $projectData : IProjectData ,
89
103
$platformsData : IPlatformsData ) {
90
104
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 ) ;
92
106
}
93
107
94
108
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 ) ;
96
110
}
97
111
}
98
112
0 commit comments