1
1
import { ERROR_NO_VALID_SUBCOMMAND_FORMAT } from "../common/constants" ;
2
- import {
3
- ANDROID_RELEASE_BUILD_ERROR_MESSAGE ,
4
- ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE ,
5
- } from "../constants" ;
2
+ import { IErrors , IHostInfo } from "../common/declarations" ;
6
3
import { cache } from "../common/decorators" ;
7
- import { hasValidAndroidSigning } from "../common/helpers" ;
8
- import { IProjectData , IProjectDataService } from "../definitions/project" ;
9
- import { IMigrateController } from "../definitions/migrate" ;
10
- import { IOptions , IPlatformValidationService } from "../declarations" ;
11
4
import { ICommand , ICommandParameter } from "../common/definitions/commands" ;
12
- import { IErrors , IHostInfo } from "../common/declarations" ;
5
+ import {
6
+ IKeyCommandHelper ,
7
+ IKeyCommandPlatform ,
8
+ } from "../common/definitions/key-commands" ;
13
9
import { IInjector } from "../common/definitions/yok" ;
10
+ import { hasValidAndroidSigning } from "../common/helpers" ;
14
11
import { injector } from "../common/yok" ;
12
+ import {
13
+ ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE ,
14
+ ANDROID_RELEASE_BUILD_ERROR_MESSAGE ,
15
+ } from "../constants" ;
16
+ import { IOptions , IPlatformValidationService } from "../declarations" ;
17
+ import { IMigrateController } from "../definitions/migrate" ;
18
+ import { IProjectData , IProjectDataService } from "../definitions/project" ;
15
19
16
20
export class RunCommandBase implements ICommand {
17
- private liveSyncCommandHelperAdditionalOptions : ILiveSyncCommandHelperAdditionalOptions = <
18
- ILiveSyncCommandHelperAdditionalOptions
19
- > { } ;
21
+ private liveSyncCommandHelperAdditionalOptions : ILiveSyncCommandHelperAdditionalOptions =
22
+ < ILiveSyncCommandHelperAdditionalOptions > { } ;
20
23
21
24
public platform : string ;
22
25
constructor (
@@ -26,14 +29,20 @@ export class RunCommandBase implements ICommand {
26
29
private $liveSyncCommandHelper : ILiveSyncCommandHelper ,
27
30
private $migrateController : IMigrateController ,
28
31
private $options : IOptions ,
29
- private $projectData : IProjectData
32
+ private $projectData : IProjectData ,
33
+ private $keyCommandHelper : IKeyCommandHelper ,
30
34
) { }
31
35
32
36
public allowedParameters : ICommandParameter [ ] = [ ] ;
33
37
public async execute ( args : string [ ] ) : Promise < void > {
34
- return this . $liveSyncCommandHelper . executeCommandLiveSync (
38
+ await this . $liveSyncCommandHelper . executeCommandLiveSync (
35
39
this . platform ,
36
- this . liveSyncCommandHelperAdditionalOptions
40
+ this . liveSyncCommandHelperAdditionalOptions ,
41
+ ) ;
42
+
43
+ this . $keyCommandHelper . attachKeyCommands (
44
+ this . platform as IKeyCommandPlatform ,
45
+ "run" ,
37
46
) ;
38
47
}
39
48
@@ -89,7 +98,7 @@ export class RunIosCommand implements ICommand {
89
98
private $injector : IInjector ,
90
99
private $options : IOptions ,
91
100
private $platformValidationService : IPlatformValidationService ,
92
- private $projectDataService : IProjectDataService
101
+ private $projectDataService : IProjectDataService ,
93
102
) { }
94
103
95
104
public async execute ( args : string [ ] ) : Promise < void > {
@@ -102,11 +111,11 @@ export class RunIosCommand implements ICommand {
102
111
if (
103
112
! this . $platformValidationService . isPlatformSupportedForOS (
104
113
this . $devicePlatformsConstants . iOS ,
105
- projectData
114
+ projectData ,
106
115
)
107
116
) {
108
117
this . $errors . fail (
109
- `Applications for platform ${ this . $devicePlatformsConstants . iOS } can not be built on this OS`
118
+ `Applications for platform ${ this . $devicePlatformsConstants . iOS } can not be built on this OS` ,
110
119
) ;
111
120
}
112
121
@@ -116,7 +125,7 @@ export class RunIosCommand implements ICommand {
116
125
this . $options . provision ,
117
126
this . $options . teamId ,
118
127
projectData ,
119
- this . $devicePlatformsConstants . iOS . toLowerCase ( )
128
+ this . $devicePlatformsConstants . iOS . toLowerCase ( ) ,
120
129
) ) ;
121
130
return result ;
122
131
}
@@ -143,7 +152,7 @@ export class RunAndroidCommand implements ICommand {
143
152
private $injector : IInjector ,
144
153
private $options : IOptions ,
145
154
private $platformValidationService : IPlatformValidationService ,
146
- private $projectData : IProjectData
155
+ private $projectData : IProjectData ,
147
156
) { }
148
157
149
158
public async execute ( args : string [ ] ) : Promise < void > {
@@ -156,11 +165,11 @@ export class RunAndroidCommand implements ICommand {
156
165
if (
157
166
! this . $platformValidationService . isPlatformSupportedForOS (
158
167
this . $devicePlatformsConstants . Android ,
159
- this . $projectData
168
+ this . $projectData ,
160
169
)
161
170
) {
162
171
this . $errors . fail (
163
- `Applications for platform ${ this . $devicePlatformsConstants . Android } can not be built on this OS`
172
+ `Applications for platform ${ this . $devicePlatformsConstants . Android } can not be built on this OS` ,
164
173
) ;
165
174
}
166
175
@@ -179,7 +188,7 @@ export class RunAndroidCommand implements ICommand {
179
188
this . $options . provision ,
180
189
this . $options . teamId ,
181
190
this . $projectData ,
182
- this . $devicePlatformsConstants . Android . toLowerCase ( )
191
+ this . $devicePlatformsConstants . Android . toLowerCase ( ) ,
183
192
) ;
184
193
}
185
194
}
0 commit comments