You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Retooled some turnkey device management (DeviceInfo now knows its platform, so we don't need to associate a platform externally) - Changed Control command to use Gauntlet devices to do the PowerOn etc type stuff since there is already support for device control in Gauntlet. Now Turnkey is more of an interactive/scriptable frontend to Gauntlet - Allow for a platform to do a manual Sdk installation, which doesn't depend on finding a Turnkey file source - Allow for a platform SDK to return custom versions. This is solely used by platform-specific code #rb brandon.schaefer [CL 15201829 by Josh Adams in ue5-main branch]
79 lines
2.0 KiB
C#
79 lines
2.0 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
using Gauntlet;
|
|
|
|
namespace Turnkey
|
|
{
|
|
static class TurnkeyGauntletUtils
|
|
{
|
|
|
|
static public ITargetDevice GetGauntletDevice(UnrealTargetPlatform Platform, string DeviceName)
|
|
{
|
|
IDeviceFactory Factory = Gauntlet.Utils.InterfaceHelpers.FindImplementations<IDeviceFactory>()
|
|
.Where(F => F.CanSupportPlatform(Platform))
|
|
.FirstOrDefault();
|
|
|
|
if (Factory == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return Factory.CreateDevice(DeviceName, null);
|
|
}
|
|
|
|
static public ITargetDevice GetGauntletDevice(DeviceInfo Device)
|
|
{
|
|
IDeviceFactory Factory = Gauntlet.Utils.InterfaceHelpers.FindImplementations<IDeviceFactory>()
|
|
.Where(F => F.CanSupportPlatform(Device.Platform))
|
|
.FirstOrDefault();
|
|
|
|
if (Factory == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return Factory.CreateDevice(Device.Name, null);
|
|
}
|
|
|
|
static public List<ITargetDevice> GetGauntletDevices(UnrealTargetPlatform Platform, List<string> DeviceNames)
|
|
{
|
|
IDeviceFactory Factory = Gauntlet.Utils.InterfaceHelpers.FindImplementations<IDeviceFactory>()
|
|
.Where(F => F.CanSupportPlatform(Platform))
|
|
.FirstOrDefault();
|
|
|
|
if (Factory == null)
|
|
{
|
|
return new List<ITargetDevice>();
|
|
}
|
|
|
|
return DeviceNames.Select(x => Factory.CreateDevice(x, null)).ToList();
|
|
}
|
|
|
|
static public List<ITargetDevice> GetGauntletDevices(List<DeviceInfo> Devices)
|
|
{
|
|
return Devices.Select(x => GetGauntletDevice(x)).Where(x => x != null).ToList();
|
|
}
|
|
|
|
static public List<ITargetDevice> GetDefaultGauntletDevices(UnrealTargetPlatform Platform)
|
|
{
|
|
IDefaultDeviceSource DeviceSource = Gauntlet.Utils.InterfaceHelpers.FindImplementations<IDefaultDeviceSource>()
|
|
.Where(S => S.CanSupportPlatform(Platform))
|
|
.FirstOrDefault();
|
|
|
|
if (DeviceSource == null)
|
|
{
|
|
return new List<ITargetDevice>();
|
|
}
|
|
|
|
return DeviceSource.GetDefaultDevices().ToList();
|
|
}
|
|
|
|
|
|
}
|
|
}
|