@@ -18,31 +18,42 @@ export class DeployOnDeviceCommand extends ValidatePlatformCommandBase implement
1818 private $mobileHelper : Mobile . IMobileHelper ,
1919 $platformsDataService : IPlatformsDataService ,
2020 private $deployCommandHelper : DeployCommandHelper ,
21- private $androidBundleValidatorHelper : IAndroidBundleValidatorHelper ) {
21+ private $androidBundleValidatorHelper : IAndroidBundleValidatorHelper ,
22+ private $markingModeService : IMarkingModeService ,
23+ private $migrateController : IMigrateController ) {
2224 super ( $options , $platformsDataService , $platformValidationService , $projectData ) ;
2325 this . $projectData . initializeProjectData ( ) ;
2426 }
2527
2628 public async execute ( args : string [ ] ) : Promise < void > {
27- const platform = args [ 0 ] . toLowerCase ( ) ;
29+ const platform = args [ 0 ] ;
30+ if ( this . $mobileHelper . isAndroidPlatform ( platform ) ) {
31+ await this . $markingModeService . handleMarkingModeFullDeprecation ( { projectDir : this . $projectData . projectDir , skipWarnings : true } ) ;
32+ }
33+
2834 await this . $deployCommandHelper . deploy ( platform ) ;
2935 }
3036
3137 public async canExecute ( args : string [ ] ) : Promise < boolean > {
38+ const platform = args [ 0 ] ;
39+ if ( ! this . $options . force ) {
40+ await this . $migrateController . validate ( { projectDir : this . $projectData . projectDir , platforms : [ platform ] } ) ;
41+ }
42+
3243 this . $androidBundleValidatorHelper . validateNoAab ( ) ;
3344 if ( ! args || ! args . length || args . length > 1 ) {
3445 return false ;
3546 }
3647
37- if ( ! ( await this . $platformCommandParameter . validate ( args [ 0 ] ) ) ) {
48+ if ( ! ( await this . $platformCommandParameter . validate ( platform ) ) ) {
3849 return false ;
3950 }
4051
41- if ( this . $mobileHelper . isAndroidPlatform ( args [ 0 ] ) && this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
52+ if ( this . $mobileHelper . isAndroidPlatform ( platform ) && this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
4253 this . $errors . failWithHelp ( ANDROID_RELEASE_BUILD_ERROR_MESSAGE ) ;
4354 }
4455
45- const result = await super . canExecuteCommandBase ( args [ 0 ] , { validateOptions : true } ) ;
56+ const result = await super . canExecuteCommandBase ( platform , { validateOptions : true } ) ;
4657 return result ;
4758 }
4859}
0 commit comments