You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
========================== MAJOR FEATURES + CHANGES ========================== Change 2790858 on 2015/12/04 by Ben.Marsh Fix ERRORLEVEL not being correctly returned by build.bat, causing failed builds to be treated as succeeded builds when launched from Visual Studio. #codereview Wes.Hunt Change 2792683 on 2015/12/07 by Matthew.Griffin Removed some usages of RunningRocket() function Checks for whether engine tools need rebuilding should be ignored in all installed engine builds. New Intermediate folders should be within project directory and engine's should not be removed when engine installed. Change 2794194 on 2015/12/08 by Matthew.Griffin Removed IsRocket function. Changed IsEngineInstalled so that -NotInstalledEngine will always disable installed engine behavior. Change 2801483 on 2015/12/14 by Matthew.Griffin Removed uses of UnrealBuildTool.RunningRocket() Mac Tool chain test was down to Engine libraries being pre-compiled Allow Third Party dependencies in any monolithic target, not just games All installed engine builds should use shared build environment Removed test no longer needed now that projects from installed builds have game targets Include engine source if it exists in any installed build to improve intellisense in VCProjects Change 2803276 on 2015/12/15 by Matthew.Griffin Removed Rocket switch from ProjectParams as it can always check Automation.RunningRocket() Removed bGeneratingRocketProjectFiles from ProjectFileGenerator as it can always check UnrealBuildTool.RunningRocket() Changed a few usages to IsEngineInstalled where obvious Change 2814190 on 2016/01/03 by Ben.Marsh Convert ParallelExecutor to managed code, so we can use it trivially from UAT without having to compile with UBT first. Should be moved into UBT at some point. Also add a support class for creating managed child processes, which are terminated automatically if the parent process is closed. Currently only implemented on Windows, using P/Invoke. Also allows setting priority level of the process, which could replace the hacky way that we determine the physical processor count in UBT. Change 2822503 on 2016/01/10 by Wes.Hunt AnalyticsET now uses the Data Router protocol. * Automatically detects configs that try to use the old endpoint and routes them to the new endpoint. This code is temp until internal games merge the code and have a chance to update their configs. * There is a new attribute on BeginSession called "LegacyURL" that is "true" if the code needs to have its configs updated, as well as a LogAnalytics warning. * Updated EngineAnalytics and AutomationAnalytics providers to use the new URL and specify any appropriate new, optional config values. * Update CrashReporter provider to use new URL and simplified it's provider configuration (now uses AnalyticsET config struct directly). Removed recently added GetUE4TypeOverride and moved it to the one place in Engine that needs it. #jira UE-21755 #lockdown nick.penwarden [CL 2822983 by Wes Hunt in Main branch]
139 lines
5.0 KiB
C#
139 lines
5.0 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
// This software is provided "as-is," without any express or implied warranty.
|
|
// In no event shall the author, nor Epic Games, Inc. be held liable for any damages arising from the use of this software.
|
|
// This software will not be supported.
|
|
// Use at your own risk.
|
|
using System;
|
|
using System.Threading;
|
|
using System.Diagnostics;
|
|
using UnrealBuildTool;
|
|
using System.Reflection;
|
|
using Tools.DotNETCommon;
|
|
using System.IO;
|
|
|
|
namespace AutomationTool
|
|
{
|
|
public class Program
|
|
{
|
|
[STAThread]
|
|
public static int Main()
|
|
{
|
|
var CommandLine = SharedUtils.ParseCommandLine();
|
|
LogUtils.InitLogging(CommandLine);
|
|
|
|
ExitCode ReturnCode = ExitCode.Success;
|
|
|
|
try
|
|
{
|
|
// ensure we can resolve any external assemblies as necessary.
|
|
AssemblyUtils.InstallAssemblyResolver(Path.GetDirectoryName(Assembly.GetEntryAssembly().GetOriginalLocation()));
|
|
HostPlatform.Initialize();
|
|
|
|
Log.TraceVerbose("{2}: Running on {0} as a {1}-bit process.", HostPlatform.Current.GetType().Name, Environment.Is64BitProcess ? 64 : 32, DateTime.UtcNow.ToString("o"));
|
|
|
|
XmlConfigLoader.Init();
|
|
|
|
// Log if we're running from the launcher
|
|
var ExecutingAssemblyLocation = Assembly.GetExecutingAssembly().Location;
|
|
if (string.Compare(ExecutingAssemblyLocation, Assembly.GetEntryAssembly().GetOriginalLocation(), StringComparison.OrdinalIgnoreCase) != 0)
|
|
{
|
|
Log.TraceVerbose("Executed from AutomationToolLauncher ({0})", ExecutingAssemblyLocation);
|
|
}
|
|
Log.TraceVerbose("CWD={0}", Environment.CurrentDirectory);
|
|
|
|
// Hook up exit callbacks
|
|
var Domain = AppDomain.CurrentDomain;
|
|
Domain.ProcessExit += Domain_ProcessExit;
|
|
Domain.DomainUnload += Domain_ProcessExit;
|
|
HostPlatform.Current.SetConsoleCtrlHandler(CtrlHandler);
|
|
|
|
var Version = AssemblyUtils.ExecutableVersion;
|
|
Log.TraceVerbose("{0} ver. {1}", Version.ProductName, Version.ProductVersion);
|
|
|
|
// Don't allow simultaneous execution of AT (in the same branch)
|
|
ReturnCode = InternalUtils.RunSingleInstance(MainProc, CommandLine);
|
|
|
|
}
|
|
catch (AutomationException Ex)
|
|
{
|
|
Log.TraceError("AutomationTool terminated with exception: {0}", Ex);
|
|
ReturnCode = Ex.ErrorCode;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// Catch all exceptions and propagate the ErrorCode if we are given one.
|
|
Log.TraceError("AutomationTool terminated with exception: {0}", Ex);
|
|
ReturnCode = ExitCode.Error_Unknown;
|
|
}
|
|
finally
|
|
{
|
|
// In all cases, do necessary shut down stuff, but don't let any additional exceptions leak out while trying to shut down.
|
|
|
|
// Make sure there's no directories on the stack.
|
|
NoThrow(() => CommandUtils.ClearDirStack(), "Clear Dir Stack");
|
|
|
|
// Try to kill process before app domain exits to leave the other KillAll call to extreme edge cases
|
|
NoThrow(() => { if (ShouldKillProcesses && !Utils.IsRunningOnMono) ProcessManager.KillAll(); }, "Kill All Processes");
|
|
|
|
Log.TraceInformation("AutomationTool exiting with ExitCode={0} ({1})", (int)ReturnCode, ReturnCode);
|
|
|
|
// Can't use NoThrow here because the code logs exceptions. We're shutting down logging!
|
|
LogUtils.ShutdownLogging();
|
|
}
|
|
|
|
// STOP: No code beyond the return statement should go beyond this point!
|
|
// Nothing should happen after the finally block above is finished.
|
|
return (int)ReturnCode;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Wraps an action in an exception block.
|
|
/// Ensures individual actions can be performed and exceptions won't prevent further actions from being executed.
|
|
/// Useful for shutdown code where shutdown may be in several stages and it's important that all stages get a chance to run.
|
|
/// </summary>
|
|
/// <param name="Action"></param>
|
|
private static void NoThrow(System.Action Action, string ActionDesc)
|
|
{
|
|
try
|
|
{
|
|
Action();
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
Log.TraceError("Exception performing nothrow action \"{0}\": {1}", ActionDesc, LogUtils.FormatException(Ex));
|
|
}
|
|
}
|
|
|
|
static bool CtrlHandler(CtrlTypes EventType)
|
|
{
|
|
Domain_ProcessExit(null, null);
|
|
if (EventType == CtrlTypes.CTRL_C_EVENT)
|
|
{
|
|
// Force exit
|
|
Environment.Exit(3);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static void Domain_ProcessExit(object sender, EventArgs e)
|
|
{
|
|
// Kill all spawned processes (Console instead of Log because logging is closed at this time anyway)
|
|
Console.WriteLine("Domain_ProcessExit");
|
|
if (ShouldKillProcesses && !Utils.IsRunningOnMono)
|
|
{
|
|
ProcessManager.KillAll();
|
|
}
|
|
Trace.Close();
|
|
}
|
|
|
|
static ExitCode MainProc(object Param)
|
|
{
|
|
ExitCode Result = Automation.Process((string[])Param);
|
|
ShouldKillProcesses = Automation.ShouldKillProcesses;
|
|
return Result;
|
|
}
|
|
|
|
static bool ShouldKillProcesses = true;
|
|
}
|
|
}
|