@@ -278,3 +278,58 @@ export class BuildVisionOsCommand extends BuildIosCommand implements ICommand {
278278
279279injector . registerCommand ( "build|vision" , BuildVisionOsCommand ) ;
280280injector . registerCommand ( "build|visionos" , BuildVisionOsCommand ) ;
281+
282+ export class BuildTvOsCommand extends BuildVisionOsCommand implements ICommand {
283+ // The injector resolves dependencies by constructor parameter name, so the
284+ // constructor has to be spelled out even though it only forwards.
285+ constructor (
286+ protected $options : IOptions ,
287+ $errors : IErrors ,
288+ $projectData : IProjectData ,
289+ $platformsDataService : IPlatformsDataService ,
290+ $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
291+ $buildController : IBuildController ,
292+ $platformValidationService : IPlatformValidationService ,
293+ $logger : ILogger ,
294+ $buildDataService : IBuildDataService ,
295+ protected $migrateController : IMigrateController ,
296+ ) {
297+ super (
298+ $options ,
299+ $errors ,
300+ $projectData ,
301+ $platformsDataService ,
302+ $devicePlatformsConstants ,
303+ $buildController ,
304+ $platformValidationService ,
305+ $logger ,
306+ $buildDataService ,
307+ $migrateController ,
308+ ) ;
309+ }
310+
311+ public async execute ( args : string [ ] ) : Promise < void > {
312+ await this . executeCore ( [ this . $devicePlatformsConstants . tvOS . toLowerCase ( ) ] ) ;
313+ }
314+
315+ public async canExecute ( args : string [ ] ) : Promise < boolean > {
316+ const platform = this . $devicePlatformsConstants . tvOS ;
317+ if ( ! this . $options . force ) {
318+ await this . $migrateController . validate ( {
319+ projectDir : this . $projectData . projectDir ,
320+ platforms : [ platform ] ,
321+ } ) ;
322+ }
323+
324+ super . validatePlatform ( platform ) ;
325+
326+ let canExecute = await super . canExecuteCommandBase ( platform ) ;
327+ if ( canExecute ) {
328+ canExecute = await super . validateArgs ( args , platform ) ;
329+ }
330+
331+ return canExecute ;
332+ }
333+ }
334+
335+ injector . registerCommand ( "build|tvos" , BuildTvOsCommand ) ;
0 commit comments