// Copyright Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Diagnostics; using EpicGames.Core; namespace AutomationTool { /// /// Host platform abstraction /// public abstract class HostPlatform { /// /// Current running host platform. /// public static readonly HostPlatform Current = Initialize(); /// /// Initializes the current platform. /// private static HostPlatform Initialize() { switch (RuntimePlatform.Current) { case RuntimePlatform.Type.Windows: return new WindowsHostPlatform(); case RuntimePlatform.Type.Mac: return new MacHostPlatform(); case RuntimePlatform.Type.Linux: return new LinuxHostPlatform(); } throw new Exception ("Unhandled runtime platform " + Environment.OSVersion.Platform); } /// /// Gets the build executable filename for NET Framework projects e.g. msbuild, or xbuild /// /// abstract public string GetFrameworkMsbuildExe(); /// /// Gets the path to dotnet /// /// abstract public FileReference GetDotnetExe(); /// /// Gets the build executable filename for NET Core projects. Typically, the path to the bundled dotnet executable. /// /// abstract public string GetDotnetMsbuildExe(); /// /// Folder under UE4/ to the platform's binaries. /// abstract public string RelativeBinariesFolder { get; } /// /// Full path to the UE4 Editor executable for the current platform. /// /// /// abstract public string GetUE4ExePath(string UE4Exe); /// /// Log folder for local builds. /// abstract public string LocalBuildsLogFolder { get; } /// /// Name of the p4 executable. /// abstract public string P4Exe { get; } /// /// Creates a process and sets it up for the current platform. /// /// /// abstract public Process CreateProcess(string AppName); /// /// Sets any additional options for running an executable. /// /// /// /// abstract public void SetupOptionsForRun(ref string AppName, ref CommandUtils.ERunOptions Options, ref string CommandLine); /// /// Sets the console control handler for the current platform. /// /// abstract public void SetConsoleCtrlHandler(ProcessManager.CtrlHandlerDelegate Handler); /// /// Platform specific override to skip loading/compiling unsupported modules /// /// Module name /// True if module should be compiled or loaded abstract public bool IsScriptModuleSupported(string ModuleName); /// /// Returns the type of the host editor platform. /// abstract public UnrealBuildTool.UnrealTargetPlatform HostEditorPlatform { get; } /// /// Returns the pdb file extenstion for the host platform. /// abstract public string PdbExtension { get; } /// /// List of processes that can't not be killed /// abstract public string[] DontKillProcessList { get; } } }