1
1
export class BuildCommandBase {
2
2
constructor ( protected $options : IOptions ,
3
- private $platformService : IPlatformService ) { }
3
+ protected $platformsData : IPlatformsData ,
4
+ protected $platformService : IPlatformService ) { }
4
5
5
6
executeCore ( args : string [ ] ) : IFuture < void > {
6
7
return ( ( ) => {
@@ -13,13 +14,17 @@ export class BuildCommandBase {
13
14
}
14
15
} ) . future < void > ( ) ( ) ;
15
16
}
17
+
18
+ public canExecute ( args : string [ ] ) : IFuture < boolean > {
19
+ return this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
20
+ }
16
21
}
17
22
18
23
export class BuildIosCommand extends BuildCommandBase implements ICommand {
19
24
constructor ( protected $options : IOptions ,
20
- private $platformsData : IPlatformsData ,
25
+ $platformsData : IPlatformsData ,
21
26
$platformService : IPlatformService ) {
22
- super ( $options , $platformService ) ;
27
+ super ( $options , $platformsData , $ platformService) ;
23
28
}
24
29
25
30
public allowedParameters : ICommandParameter [ ] = [ ] ;
@@ -32,10 +37,10 @@ $injector.registerCommand("build|ios", BuildIosCommand);
32
37
33
38
export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
34
39
constructor ( protected $options : IOptions ,
35
- private $platformsData : IPlatformsData ,
40
+ $platformsData : IPlatformsData ,
36
41
private $errors : IErrors ,
37
42
$platformService : IPlatformService ) {
38
- super ( $options , $platformService ) ;
43
+ super ( $options , $platformsData , $ platformService) ;
39
44
}
40
45
41
46
public execute ( args : string [ ] ) : IFuture < void > {
@@ -49,7 +54,7 @@ export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
49
54
if ( this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
50
55
this . $errors . fail ( "When producing a release build, you need to specify all --key-store-* options." ) ;
51
56
}
52
- return args . length === 0 ;
57
+ return args . length === 0 && this . $platformService . validateOptions ( args [ 0 ] ) . wait ( ) ;
53
58
} ) . future < boolean > ( ) ( ) ;
54
59
}
55
60
}
0 commit comments