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 2909886 on 2016/03/15 by Matthew.Griffin
Adding a build exception to give a message instead of crashing when trying to generate all project files from an installed build.
Change 2911727 on 2016/03/16 by Matthew.Griffin
Added Platform Type and Architecture to Installed Platform Info
Reworked the different IsValid... functions to use lamdas to reduce duplicated code looping and checking receipts
Moved the code to write config file entries into InstalledPlatformInfo so that it can be reused by anyone wanting to make installed builds
Added temporary hack to write Android architecture until I can get it from build process
Change 2913692 on 2016/03/17 by Ben.Marsh
UAT: Move script to archive a build for UGS into a public folder.
Change 2915445 on 2016/03/18 by Ben.Marsh
UAT: Reduce the number of redundant log warnings/errors after a reported build failure, and simplify calls to ParallelExecutor which don't need retrying.
Change 2915450 on 2016/03/18 by Ben.Marsh
UAT: Suppress warning messages trying to kill child processes if the operation failed because it's already exited.
Change 2925830 on 2016/03/29 by Matthew.Griffin
Added new selective download tags
Added a test for whether installed platforms are missing required files so that we can try to open the launcher to the installer settings
Change 2926437 on 2016/03/29 by Ben.Marsh
PR #2210: Fix "Rebuild.bat" for paths with parentheses (Contributed by amcofi)
Change 2927399 on 2016/03/30 by Matthew.Griffin
Updating use of PDBCopy to look in VS2015 folder and fall back to VS2013 version if it doesn't exist.
Change 2933093 on 2016/04/05 by Ben.Marsh
PR #2232: Updated copyright text to 2016 (Contributed by erikbye)
Change 2936221 on 2016/04/07 by Matthew.Griffin
Adding checks on architecture for android config options
Change 2938021 on 2016/04/08 by Ben.Marsh
UAT: Prevent UnauthorizedAccessException when enumerating crash files on Mac from a restricted user account.
Change 2939332 on 2016/04/11 by Matthew.Griffin
Added AdditionalBundleResources to external file list so that they should be included in Launcher releases
Change 2939767 on 2016/04/11 by Ben.Marsh
BuildGraph: Add a -preprocess option, which will cause the preprocessed and culled graph out to an XML file for debugging.
Change 2941611 on 2016/04/12 by Ben.Marsh
UAT: Prevent warning about commands requiring P4 if -p4 is specified on the command line.
Change 2942037 on 2016/04/13 by Ben.Marsh
UBT: Only print 'Detailed Action Stats' message footer if there were any detailed action stats.
Change 2942640 on 2016/04/13 by Ben.Marsh
GUBP: Trigger GitHub promotions by triggering a new procedure rather than scanning for labels.
Change 2942728 on 2016/04/13 by Ben.Marsh
BuildGraph: Rename "AgentGroup" to "Agent" for consistency with XML.
Change 2942735 on 2016/04/13 by Ben.Marsh
BuildGraph: Few renames to match class names (Build.cs -> BuildGraph.cs, AgentGroup.cs -> Agent.cs)
Change 2943568 on 2016/04/14 by Ben.Marsh
EC: Print out the log folder at the start of each job.
Change 2944421 on 2016/04/14 by Ben.Marsh
EC: Add GitHub dashboard page which shows the current syncing state
#lockdown Nick.Penwarden
[CL 2944733 by Ben Marsh in Main branch]
205 lines
6.7 KiB
C#
205 lines
6.7 KiB
C#
using AutomationTool;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml;
|
|
using UnrealBuildTool;
|
|
|
|
namespace BuildGraph.Tasks
|
|
{
|
|
/// <summary>
|
|
/// Parameters for a task that runs the cooker
|
|
/// </summary>
|
|
public class PakFileTaskParameters
|
|
{
|
|
/// <summary>
|
|
/// List of files, wildcards and tag sets to add to the pak file, separated by ';' characters.
|
|
/// </summary>
|
|
[TaskParameter]
|
|
public string Files;
|
|
|
|
/// <summary>
|
|
/// PAK file to output
|
|
/// </summary>
|
|
[TaskParameter]
|
|
public string Output;
|
|
|
|
/// <summary>
|
|
/// Directories to rebase the files relative to. If specified, the shortest path under a listed directory will be used for each file.
|
|
/// </summary>
|
|
[TaskParameter(Optional = true)]
|
|
public string RebaseDir;
|
|
|
|
/// <summary>
|
|
/// Script which gives the order of files
|
|
/// </summary>
|
|
[TaskParameter(Optional = true)]
|
|
public string Order;
|
|
|
|
/// <summary>
|
|
/// Encryption keys for this pak file
|
|
/// </summary>
|
|
[TaskParameter(Optional = true)]
|
|
public string Sign;
|
|
|
|
/// <summary>
|
|
/// Whether to compress files
|
|
/// </summary>
|
|
[TaskParameter(Optional = true)]
|
|
public bool Compress = true;
|
|
|
|
/// <summary>
|
|
/// Additional arguments to be passed to UnrealPak
|
|
/// </summary>
|
|
[TaskParameter(Optional = true)]
|
|
public string Arguments = "";
|
|
|
|
/// <summary>
|
|
/// Tag to be applied to build products of this task
|
|
/// </summary>
|
|
[TaskParameter(Optional = true, ValidationType = TaskParameterValidationType.Tag)]
|
|
public string Tag;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Cook a selection of maps for a certain platform
|
|
/// </summary>
|
|
[TaskElement("PakFile", typeof(PakFileTaskParameters))]
|
|
public class PakFileTask : CustomTask
|
|
{
|
|
/// <summary>
|
|
/// Parameters for the task
|
|
/// </summary>
|
|
PakFileTaskParameters Parameters;
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="InParameters">Parameters for this task</param>
|
|
public PakFileTask(PakFileTaskParameters InParameters)
|
|
{
|
|
Parameters = InParameters;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Execute the task.
|
|
/// </summary>
|
|
/// <param name="Job">Information about the current job</param>
|
|
/// <param name="BuildProducts">Set of build products produced by this node.</param>
|
|
/// <param name="TagNameToFileSet">Mapping from tag names to the set of files they include</param>
|
|
/// <returns>True if the task succeeded</returns>
|
|
public override bool Execute(JobContext Job, HashSet<FileReference> BuildProducts, Dictionary<string, HashSet<FileReference>> TagNameToFileSet)
|
|
{
|
|
// Find the directories we're going to rebase relative to
|
|
HashSet<DirectoryReference> RebaseDirs = new HashSet<DirectoryReference>{ CommandUtils.RootDirectory };
|
|
if(Parameters.RebaseDir != null)
|
|
{
|
|
RebaseDirs.UnionWith(SplitDelimitedList(Parameters.RebaseDir).Select(x => ResolveDirectory(x)));
|
|
}
|
|
|
|
// Get the output parameter
|
|
FileReference OutputFile = ResolveFile(Parameters.Output);
|
|
|
|
// Get a unique filename for the response file
|
|
FileReference ResponseFile = FileReference.Combine(new DirectoryReference(CommandUtils.CmdEnv.LogFolder), String.Format("PakList_{0}.txt", OutputFile.GetFileNameWithoutExtension()));
|
|
for(int Idx = 2; ResponseFile.Exists(); Idx++)
|
|
{
|
|
ResponseFile = FileReference.Combine(ResponseFile.Directory, String.Format("PakList_{0}_{1}.txt", OutputFile.GetFileNameWithoutExtension(), Idx));
|
|
}
|
|
|
|
// Write out the response file
|
|
HashSet<FileReference> Files = ResolveFilespec(CommandUtils.RootDirectory, Parameters.Files, TagNameToFileSet);
|
|
using(StreamWriter Writer = new StreamWriter(ResponseFile.FullName, false, new System.Text.UTF8Encoding(true)))
|
|
{
|
|
foreach(FileReference File in Files)
|
|
{
|
|
string RelativePath = FindShortestRelativePath(File, RebaseDirs);
|
|
if(RelativePath == null)
|
|
{
|
|
CommandUtils.LogError("Couldn't find relative path for '{0}' - not under any rebase directories", File.FullName);
|
|
return false;
|
|
}
|
|
Writer.WriteLine("\"{0}\" \"{1}\"{2}", File.FullName, RelativePath, Parameters.Compress? " -compress" : "");
|
|
}
|
|
}
|
|
|
|
// Format the command line
|
|
StringBuilder CommandLine = new StringBuilder();
|
|
CommandLine.AppendFormat("{0} -create={1}", CommandUtils.MakePathSafeToUseWithCommandLine(OutputFile.FullName), CommandUtils.MakePathSafeToUseWithCommandLine(ResponseFile.FullName));
|
|
if(Parameters.Sign != null)
|
|
{
|
|
CommandLine.AppendFormat(" -sign={0}", CommandUtils.MakePathSafeToUseWithCommandLine(ResolveFile(Parameters.Sign).FullName));
|
|
}
|
|
if(Parameters.Order != null)
|
|
{
|
|
CommandLine.AppendFormat(" -order={0}", CommandUtils.MakePathSafeToUseWithCommandLine(ResolveFile(Parameters.Order).FullName));
|
|
}
|
|
if (GlobalCommandLine.Installed)
|
|
{
|
|
CommandLine.Append(" -installed");
|
|
}
|
|
if (GlobalCommandLine.UTF8Output)
|
|
{
|
|
CommandLine.AppendFormat(" -UTF8Output");
|
|
}
|
|
|
|
// Get the executable path
|
|
FileReference UnrealPakExe;
|
|
if(HostPlatform.Current.HostEditorPlatform == UnrealTargetPlatform.Win64)
|
|
{
|
|
UnrealPakExe = ResolveFile("Engine/Binaries/Win64/UnrealPak.exe");
|
|
}
|
|
else
|
|
{
|
|
UnrealPakExe = ResolveFile(String.Format("Engine/Binaries/{0}/UnrealPak", HostPlatform.Current.HostEditorPlatform.ToString()));
|
|
}
|
|
|
|
// Run it
|
|
CommandUtils.Log("Running '{0} {1}'", CommandUtils.MakePathSafeToUseWithCommandLine(UnrealPakExe.FullName), CommandLine.ToString());
|
|
CommandUtils.RunAndLog(CommandUtils.CmdEnv, UnrealPakExe.FullName, CommandLine.ToString(), Options: CommandUtils.ERunOptions.Default | CommandUtils.ERunOptions.UTF8Output);
|
|
BuildProducts.Add(OutputFile);
|
|
|
|
// Apply the optional tag to the output file
|
|
if(!String.IsNullOrEmpty(Parameters.Tag))
|
|
{
|
|
FindOrAddTagSet(TagNameToFileSet, Parameters.Tag).Add(OutputFile);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Find the shortest relative path of the given file from a set of base directories.
|
|
/// </summary>
|
|
/// <param name="File">Full path to a file</param>
|
|
/// <param name="RebaseDirs">Possible base directories</param>
|
|
/// <returns>The shortest relative path, or null if the file is not under any of them</returns>
|
|
public static string FindShortestRelativePath(FileReference File, IEnumerable<DirectoryReference> RebaseDirs)
|
|
{
|
|
string RelativePath = null;
|
|
foreach(DirectoryReference RebaseDir in RebaseDirs)
|
|
{
|
|
if(File.IsUnderDirectory(RebaseDir))
|
|
{
|
|
string NewRelativePath = File.MakeRelativeTo(RebaseDir);
|
|
if(RelativePath == null || NewRelativePath.Length < RelativePath.Length)
|
|
{
|
|
RelativePath = NewRelativePath;
|
|
}
|
|
}
|
|
}
|
|
return RelativePath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Output this task out to an XML writer.
|
|
/// </summary>
|
|
public override void Write(XmlWriter Writer)
|
|
{
|
|
Write(Writer, Parameters);
|
|
}
|
|
}
|
|
}
|