11export class BuildCommandBase {
22 constructor ( protected $options : IOptions ,
3- private $platformService : IPlatformService ) { }
3+ protected $platformsData : IPlatformsData ,
4+ protected $platformService : IPlatformService ) { }
45
56 executeCore ( args : string [ ] ) : IFuture < void > {
67 return ( ( ) => {
@@ -17,25 +18,29 @@ export class BuildCommandBase {
1718
1819export class BuildIosCommand extends BuildCommandBase implements ICommand {
1920 constructor ( protected $options : IOptions ,
20- private $platformsData : IPlatformsData ,
21+ $platformsData : IPlatformsData ,
2122 $platformService : IPlatformService ) {
22- super ( $options , $platformService ) ;
23+ super ( $options , $platformsData , $ platformService) ;
2324 }
2425
2526 public allowedParameters : ICommandParameter [ ] = [ ] ;
2627
2728 public execute ( args : string [ ] ) : IFuture < void > {
2829 return this . executeCore ( [ this . $platformsData . availablePlatforms . iOS ] ) ;
2930 }
31+
32+ public canExecute ( args : string [ ] ) : IFuture < boolean > {
33+ return this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
34+ }
3035}
3136$injector . registerCommand ( "build|ios" , BuildIosCommand ) ;
3237
3338export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
3439 constructor ( protected $options : IOptions ,
35- private $platformsData : IPlatformsData ,
40+ $platformsData : IPlatformsData ,
3641 private $errors : IErrors ,
3742 $platformService : IPlatformService ) {
38- super ( $options , $platformService ) ;
43+ super ( $options , $platformsData , $ platformService) ;
3944 }
4045
4146 public execute ( args : string [ ] ) : IFuture < void > {
@@ -49,7 +54,7 @@ export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
4954 if ( this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
5055 this . $errors . fail ( "When producing a release build, you need to specify all --key-store-* options." ) ;
5156 }
52- return args . length === 0 ;
57+ return args . length === 0 && this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . Android ) . wait ( ) ;
5358 } ) . future < boolean > ( ) ( ) ;
5459 }
5560}
0 commit comments