You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Note that for Windows to work, the AutomationTool.exe needs to be marked as a Desktop app, so when running on Linux, this command is needed one time: sed -i 's/WindowsDesktop/NETCore/' AutomationTool.runtimeconfig.json - Removed some platform-specific checks for the platform building it, and #if WINDOWS type checks (not all gone, but getting better) #rb jonathan.adamczewski #preflight 6195a7de841fa7e69d5964d4 [FYI] graeme.thornton #ROBOMERGE-AUTHOR: josh.adams #ROBOMERGE-SOURCE: CL 18237766 via CL 18242422 via CL 18242492 via CL 18242564 via CL 18244551 via CL 18244617 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18244669 by josh adams in ue5-release-engine-test branch]
117 lines
2.6 KiB
C#
117 lines
2.6 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using EpicGames.Core;
|
|
using AutomationTool;
|
|
using System.Threading;
|
|
using UnrealBuildBase;
|
|
|
|
namespace Turnkey
|
|
{
|
|
class Turnkey : BuildCommand
|
|
{
|
|
public override ExitCode Execute()
|
|
{
|
|
IOProvider IOProvider;
|
|
if (ParseParam("EditorIOPort"))
|
|
{
|
|
int Port = ParseParamInt("EditorIOPort");
|
|
IOProvider = new EditorIOClient(Port);
|
|
}
|
|
else if (ParseParam("EditorIO"))
|
|
{
|
|
IOProvider = new HybridIOProvider();
|
|
}
|
|
else
|
|
{
|
|
string ReportFilename = ParseParamValue("ReportFilename");
|
|
if (!string.IsNullOrEmpty(ReportFilename))
|
|
{
|
|
IOProvider = new ReportIOProvider(ReportFilename);
|
|
}
|
|
else
|
|
{
|
|
IOProvider = new ConsoleIOProvider();
|
|
}
|
|
}
|
|
|
|
return Turnkey.Execute(IOProvider, this);
|
|
}
|
|
|
|
static bool bHasBeenInitialized = false;
|
|
public static ExitCode Execute(IOProvider IOProvider, BuildCommand CommandUtilHelper)
|
|
{
|
|
if (!bHasBeenInitialized)
|
|
{
|
|
SetupVisuals();
|
|
|
|
// cache some settings for other classes
|
|
TurnkeyUtils.SetVariable("EngineDir", Unreal.EngineDirectory.FullName);
|
|
TurnkeyUtils.SetVariable("Project", CommandUtilHelper.ParseParamValue("Project="));
|
|
|
|
TurnkeySettings.Initialize();
|
|
|
|
// Microsoft.Win32.SystemEvents.UserPreferenceChanged += new Microsoft.Win32.UserPreferenceChangedEventHandler((sender, args) => TurnkeyUtils.Log("Got a change! {0}", args.Category));
|
|
|
|
Console.CancelKeyPress += delegate
|
|
{
|
|
TurnkeyUtils.CleanupPaths();
|
|
|
|
TurnkeyUtils.Log("");
|
|
TurnkeyUtils.Log("If you installed an SDK, you should NOT \"Terminate batch job\"!");
|
|
TurnkeyUtils.Log("");
|
|
TurnkeyUtils.ExitCode = ExitCode.Success;
|
|
};
|
|
|
|
bHasBeenInitialized = true;
|
|
}
|
|
|
|
// IOProvider could change between multiple executions
|
|
TurnkeyUtils.Initialize(IOProvider, CommandUtilHelper);
|
|
|
|
|
|
try
|
|
{
|
|
// supplied command
|
|
string SuppliedCommand = TurnkeyUtils.CommandUtilHelper.ParseParamValue("Command", null);
|
|
if (SuppliedCommand != null)
|
|
{
|
|
TurnkeyCommand.ExecuteCommand(SuppliedCommand);
|
|
}
|
|
else
|
|
{
|
|
// no command will prompt
|
|
while (TurnkeyCommand.ExecuteCommand())
|
|
{
|
|
TurnkeyUtils.Log("");
|
|
}
|
|
}
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
TurnkeyUtils.Log("Turnkey exception: {0}", Ex.ToString());
|
|
}
|
|
finally
|
|
{
|
|
TurnkeyUtils.CleanupPaths();
|
|
}
|
|
|
|
return TurnkeyUtils.ExitCode;
|
|
}
|
|
|
|
#region Visuals
|
|
|
|
private static void SetupVisuals()
|
|
{
|
|
if (RuntimePlatform.IsWindows)
|
|
{
|
|
UnrealWindowsForms.Utils.SetupVisuals();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|