Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Turnkey/Commands/ListSdks.cs
josh adams 98aadf5c36 - Categorized Turnkey commands
- Added ability to have input list options be headers (prefix with ;)
#rb nuno.leiria

#ROBOMERGE-SOURCE: CL 15472185 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15472224 by josh adams in ue5-main branch]
2021-02-19 11:59:55 -04:00

53 lines
1.2 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using UnrealBuildTool;
using AutomationTool;
using System.Linq;
namespace Turnkey.Commands
{
class ListSdks : TurnkeyCommand
{
protected override CommandGroup Group => CommandGroup.Informational;
protected override void Execute(string[] CommandOptions)
{
TurnkeyUtils.Log("");
TurnkeyUtils.Log("Available Installers:");
string TypeString = TurnkeyUtils.ParseParamValue("Type", null, CommandOptions);
List<UnrealTargetPlatform> Platforms = TurnkeyUtils.GetPlatformsFromCommandLineOrUser(CommandOptions, null);
FileSource.SourceType? OptionalType = null;
if (TypeString != null)
{
FileSource.SourceType Type;
if (Enum.TryParse(TypeString, out Type))
{
OptionalType = Type;
}
}
List<FileSource> Sdks;
if (Platforms == null)
{
Sdks = TurnkeyManifest.FilterDiscoveredFileSources(null, OptionalType);
}
else
{
Sdks = Platforms.SelectMany(x => TurnkeyManifest.FilterDiscoveredFileSources(x, OptionalType)).ToList();
}
foreach (FileSource Sdk in Sdks)
{
// TurnkeyUtils.Log(Sdk.ToString(2));
TurnkeyUtils.Log(Sdk.ToString());
}
}
}
}