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]
150 lines
5.6 KiB
C#
150 lines
5.6 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnrealBuildTool;
|
|
|
|
namespace AutomationTool
|
|
{
|
|
[RequireP4]
|
|
class BuildForUGS : BuildCommand
|
|
{
|
|
public override void ExecuteBuild()
|
|
{
|
|
// Parse the target list
|
|
string[] Targets = ParseParamValues("Target");
|
|
if(Targets.Length == 0)
|
|
{
|
|
throw new AutomationException("No targets specified (eg. -Target=\"UE4Editor Win64 Development\")");
|
|
}
|
|
|
|
// Parse the archive path
|
|
string ArchivePath = ParseParamValue("Archive");
|
|
if(ArchivePath != null && (!ArchivePath.StartsWith("//") || ArchivePath.Sum(x => (x == '/')? 1 : 0) < 4))
|
|
{
|
|
throw new AutomationException("Archive path is not a valid depot filename");
|
|
}
|
|
|
|
// Prepare the build agenda
|
|
UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
|
|
foreach(string Target in Targets)
|
|
{
|
|
string[] Tokens = Target.Split(new char[]{ ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
UnrealTargetPlatform Platform;
|
|
UnrealTargetConfiguration Configuration;
|
|
if(Tokens.Length < 3 || !Enum.TryParse(Tokens[1], true, out Platform) || !Enum.TryParse(Tokens[2], true, out Configuration))
|
|
{
|
|
throw new AutomationException("Invalid target '{0}' - expected <TargetName> <Platform> <Configuration>");
|
|
}
|
|
|
|
Agenda.AddTarget(Tokens[0], Platform, Configuration, InAddArgs: String.Join(" ", Tokens.Skip(3)));
|
|
}
|
|
|
|
// Build everything
|
|
UE4Build Builder = new UE4Build(this);
|
|
Builder.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true, InForceNoXGE: true);
|
|
|
|
// Include the build products for UAT and UBT if required
|
|
if(ParseParam("WithUAT"))
|
|
{
|
|
Builder.AddUATFilesToBuildProducts();
|
|
}
|
|
if(ParseParam("WithUBT"))
|
|
{
|
|
Builder.AddUBTFilesToBuildProducts();
|
|
}
|
|
|
|
// Archive the build products
|
|
if(ArchivePath != null)
|
|
{
|
|
// Create an output folder
|
|
string OutputFolder = Path.Combine(CommandUtils.CmdEnv.LocalRoot, "ArchiveForUGS");
|
|
Directory.CreateDirectory(OutputFolder);
|
|
|
|
// Create a temp folder for storing stripped PDB files
|
|
string SymbolsFolder = Path.Combine(OutputFolder, "Symbols");
|
|
Directory.CreateDirectory(SymbolsFolder);
|
|
|
|
// Get the Windows toolchain
|
|
UEToolChain WindowsToolChain = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Win64).CreateContext(null).CreateToolChain(CPPTargetPlatform.Win64);
|
|
|
|
// Figure out all the files for the archive
|
|
Ionic.Zip.ZipFile Zip = new Ionic.Zip.ZipFile();
|
|
Zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Always;
|
|
foreach(string BuildProduct in Builder.BuildProductFiles)
|
|
{
|
|
if(!File.Exists(BuildProduct))
|
|
{
|
|
throw new AutomationException("Missing build product: {0}", BuildProduct);
|
|
}
|
|
if(BuildProduct.EndsWith(".pdb", StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
string StrippedFileName = CommandUtils.MakeRerootedFilePath(BuildProduct, CommandUtils.CmdEnv.LocalRoot, SymbolsFolder);
|
|
Directory.CreateDirectory(Path.GetDirectoryName(StrippedFileName));
|
|
WindowsToolChain.StripSymbols(BuildProduct, StrippedFileName);
|
|
Zip.AddFile(StrippedFileName, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(StrippedFileName, SymbolsFolder)));
|
|
}
|
|
else
|
|
{
|
|
Zip.AddFile(BuildProduct, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(BuildProduct, CommandUtils.CmdEnv.LocalRoot)));
|
|
}
|
|
}
|
|
// Create the zip file
|
|
string ZipFileName = Path.Combine(OutputFolder, "Archive.zip");
|
|
Console.WriteLine("Writing {0}...", ZipFileName);
|
|
Zip.Save(ZipFileName);
|
|
|
|
// Submit it to Perforce if required
|
|
if(CommandUtils.AllowSubmit)
|
|
{
|
|
// Delete any existing clientspec for submitting
|
|
string ClientName = Environment.MachineName + "_BuildForUGS";
|
|
|
|
// Create a brand new one
|
|
P4ClientInfo Client = new P4ClientInfo();
|
|
Client.Owner = Environment.UserName;
|
|
Client.Host = Environment.MachineName;
|
|
Client.Stream = ArchivePath.Substring(0, ArchivePath.IndexOf('/', ArchivePath.IndexOf('/', 2) + 1));
|
|
Client.RootPath = Path.Combine(OutputFolder, "Perforce");
|
|
Client.Name = ClientName;
|
|
Client.Options = P4ClientOption.NoAllWrite | P4ClientOption.NoClobber | P4ClientOption.NoCompress | P4ClientOption.Unlocked | P4ClientOption.NoModTime | P4ClientOption.RmDir;
|
|
Client.LineEnd = P4LineEnd.Local;
|
|
P4.CreateClient(Client, AllowSpew: false);
|
|
|
|
// Create a new P4 connection for this workspace
|
|
P4Connection SubmitP4 = new P4Connection(Client.Owner, Client.Name);
|
|
SubmitP4.Revert("-k //...");
|
|
|
|
// Figure out where the zip file has to go in Perforce
|
|
P4WhereRecord WhereZipFile = SubmitP4.Where(ArchivePath, false).FirstOrDefault(x => !x.bUnmap && x.Path != null);
|
|
if(WhereZipFile == null)
|
|
{
|
|
throw new AutomationException("Couldn't locate {0} in this workspace");
|
|
}
|
|
|
|
// Get the latest version of it
|
|
int NewCL = SubmitP4.CreateChange(Description: String.Format("[CL {0}] Updated binaries", P4Env.Changelist));
|
|
SubmitP4.Sync(String.Format("-k \"{0}\"", ArchivePath), AllowSpew:false);
|
|
CommandUtils.CopyFile(ZipFileName, WhereZipFile.Path);
|
|
SubmitP4.Add(NewCL, String.Format("\"{0}\"", ArchivePath));
|
|
SubmitP4.Edit(NewCL, String.Format("\"{0}\"", ArchivePath));
|
|
|
|
// Submit it
|
|
int SubmittedCL;
|
|
SubmitP4.Submit(NewCL, out SubmittedCL);
|
|
if(SubmittedCL <= 0)
|
|
{
|
|
throw new AutomationException("Submit failed.");
|
|
}
|
|
Console.WriteLine("Submitted in changelist {0}", SubmittedCL);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|