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
+ provision : this . $options . provision ,
32
+ teamId : this . $options . teamId
33
+ } ;
34
+ await this . $platformService . deployPlatform ( this . $devicesService . platform , appFilesUpdaterOptions , deployOptions , this . $projectData , this . $options . provision ) ;
21
35
this . $config . debugLivesync = true ;
22
36
let applicationReloadAction = async ( deviceAppData : Mobile . IDeviceAppData ) : Promise < void > => {
23
37
let projectData : IProjectData = this . $injector . resolve ( "projectData" ) ;
31
45
32
46
await deviceAppData . device . applicationManager . stopApplication ( applicationId ) ;
33
47
34
- await this . debugService . debug ( ) ;
48
+ await this . debugService . debug ( this . $projectData ) ;
35
49
} ;
36
- return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , applicationReloadAction ) ;
50
+ return this . $usbLiveSyncService . liveSync ( this . $devicesService . platform , this . $projectData , applicationReloadAction ) ;
37
51
}
38
52
39
53
public async canExecute ( args : string [ ] ) : Promise < boolean > {
@@ -64,13 +78,14 @@ export class DebugIOSCommand extends DebugPlatformCommand {
64
78
$usbLiveSyncService : ILiveSyncService ,
65
79
$platformService : IPlatformService ,
66
80
$options : IOptions ,
81
+ $projectData : IProjectData ,
67
82
$platformsData : IPlatformsData ) {
68
83
69
- super ( $iOSDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
84
+ super ( $iOSDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $projectData , $ options, $platformsData ) ;
70
85
}
71
86
72
87
public async canExecute ( args : string [ ] ) : Promise < boolean > {
73
- return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
88
+ return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $ platformsData. availablePlatforms . iOS ) ;
74
89
}
75
90
}
76
91
@@ -86,13 +101,14 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
86
101
$usbLiveSyncService : ILiveSyncService ,
87
102
$platformService : IPlatformService ,
88
103
$options : IOptions ,
104
+ $projectData : IProjectData ,
89
105
$platformsData : IPlatformsData ) {
90
106
91
- super ( $androidDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
107
+ super ( $androidDebugService , $devicesService , $injector , $logger , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $projectData , $ options, $platformsData ) ;
92
108
}
93
109
94
110
public async canExecute ( args : string [ ] ) : Promise < boolean > {
95
- return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . Android ) ;
111
+ return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $ platformsData. availablePlatforms . Android ) ;
96
112
}
97
113
}
98
114
0 commit comments