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 ( ( ) => {
@@ -17,25 +18,29 @@ export class BuildCommandBase {
17
18
18
19
export class BuildIosCommand extends BuildCommandBase implements ICommand {
19
20
constructor ( protected $options : IOptions ,
20
- private $platformsData : IPlatformsData ,
21
+ $platformsData : IPlatformsData ,
21
22
$platformService : IPlatformService ) {
22
- super ( $options , $platformService ) ;
23
+ super ( $options , $platformsData , $ platformService) ;
23
24
}
24
25
25
26
public allowedParameters : ICommandParameter [ ] = [ ] ;
26
27
27
28
public execute ( args : string [ ] ) : IFuture < void > {
28
29
return this . executeCore ( [ this . $platformsData . availablePlatforms . iOS ] ) ;
29
30
}
31
+
32
+ public canExecute ( args : string [ ] ) : IFuture < boolean > {
33
+ return this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
34
+ }
30
35
}
31
36
$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 ( this . $platformsData . availablePlatforms . Android ) . wait ( ) ;
53
58
} ) . future < boolean > ( ) ( ) ;
54
59
}
55
60
}
0 commit comments