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
==========================
#lockdown Nick.Penwarden
Change 2903938 on 2016/03/10 by Frank.Gigliotti
Added an instance ID to FAnimMontageInstance
#CodeReview Laurent.Delayen
#RB Laurent.Delayen
#Tests PIE
Change 2903745 on 2016/03/10 by Wes.Hunt
Update Oodle TPS
#rb none
#tests none
#codereview:john.pollard
Change 2903689 on 2016/03/10 by Uriel.Doyon
New "LogHeroMaterials" console command, displaying the current state of materials and textures on the character hero.
#rb marcus.wasmer
#codereview marcus.wassmer
#tests editor, playing PC games, trying the new command
Change 2903669 on 2016/03/10 by Aaron.McLeran
OR-17180 Make stat soundcues and stat soundwaves NOT display zero volume sounds
- Change only effects debug stat commands for audio guys
#rb none
#tests played paragon with new debug stat commands, confirms doesn't show zero-volume sounds
Change 2903625 on 2016/03/10 by John.Pollard
XB1 Oodle SDK
#rb none
#tests none
#codereview Jeff.Campeau
Change 2903577 on 2016/03/10 by Ben.Marsh
Remaking latest build scripts from //UE4/Main @ 2900980.
Change 2903560 on 2016/03/10 by Ben.Marsh
Initial version of BuildGraph scripts - used to create build processes in UE4 which can be run locally or in parallel across a build farm (assuming synchronization and resource allocation implemented by a separate system). Intended to supersede GUBP.
Build graphs are declared using an XML script using syntax similar to MSBuild, ANT or NAnt, and consist of the following components:
* Tasks: Building blocks which can be executed as part of the build process. Many predefined tasks are provided (<Cook>, <Compile>, <Copy>, <Stage>, <Log>, <PakFile>, etc...), and additional tasks may be added be declaring classes derived from AutomationTool.CustomTask in other UAT modules.
* Nodes: A named sequence of tasks which is executed to produce outputs. Nodes may have input dependencies on other nodes before they can be executed. Declared with the <Node> element in scripts.
* Agent Groups: A set of nodes nodes which is executed on the same machine if running as part of a build system. Has no effect when building locally. Declared with the <Group> element in scripts.
* Triggers: Container for groups which should only be executed when explicitly triggered (using the -Trigger=<Name> or -SkipTriggers command line argument). Declared with the <Trigger> element in scripts.
* Notifiers: Specifies email recipients for failures in one or more nodes, whether they should receive notifications on warnings, and so on.
Properties can be passed in to a script on the command line, or set procedurally with the <Property Name="Foo" Value="Bar"/> syntax. Properties referenced with the $(Property Name) notation are valid within all strings, and will be expanded as macros when the script is read. If a property name is not set explicitly, it defaults to the contents of an environment variable with the same name.
Local properties, which only affect the scope of the containing XML element (node, group, etc...) are declared with the <Local Name="Foo" Value="Bar"/> element, and will override a similarly named global property for the local property's scope.
Any elements can be conditionally defined via the "If" attribute, and are largely identical to MSBuild conditions. Literals in conditions may be quoted with single (') or double (") quotes, or an unquoted sequence of letters, digits and underscore characters. All literals are considered identical regardless of how they are declared, and are considered case-insensitive for comparisons (so true equals 'True', equals "TRUE"). Available operators are "==", "!=", "And", "Or", "!", "(...)", "Exists(...)" and "HasTrailingSlash(...)". A full grammar is written up in Condition.cs.
File manipulation is done using wildcards and tags. Any attribute that accepts a list of files may consist of: a Perforce-style wildcard (matching any number of "...", "*" and "?" patterns in any location), a full path name, or a reference to a tagged collection of files, denoted by prefixing with a '#' character. Files may be added to a tag set using the <Tag> Task, which also allows performing set union/difference style operations. Each node can declare multiple outputs in the form of a list of named tags, which other nodes can then depend on.
Build graphs may be executed in parallel as part build system. To do so, the initial graph configuration is generated by running with the -Export=<Filename> argument (producing a JSON file listing the nodes and dependencies to execute). Each participating agent should be synced to the same changelist, and UAT should be re-run with the appropriate -Node=<Name> argument. Outputs from different nodes are transferred between agents via shared storage, typically a network share, the path to which can be specified on the command line using the -SharedStorageDir=<Path> argument. Note that the allocation of machines, and coordination between them, is assumed to be managed by an external system.
A schema for the known set of tasks can be generated by running UAT with the "-Schema=<FileName>" option. Generating a schema and referencing it from a BuildGraph script allows Visual Studio to validate and auto-complete elements as you type.
#rb none
#codereview Marc.Audy, Wes.Hunt, Matthew.Griffin, Richard.Fawcett
#tests local only so far, but not part of any build process yet
Change 2903539 on 2016/03/10 by John.Pollard
Improve replay playback debugging of character movement
#rb none
#tests replays
Change 2903526 on 2016/03/10 by Ben.Marsh
Remake changes from //UE4/Main without integration history, to add support for BuildGraph tasks.
#rb none
#tests none
Change 2903512 on 2016/03/10 by Dan.Youhon
Modify minimum Duration values for JumpForce and MoveToForce ability tasks so that having minimum Duration values doesn't trigger check()s
#rb None
#tests Compiles
Change 2903474 on 2016/03/10 by Marc.Audy
Fix crash if ChildActor is null
#rb None
#tests None
Change 2903314 on 2016/03/10 by Marc.Audy
Fix ParentComponent not being persisted and fixup content that was saved in the window it was broken
#rb James.Golding
#tests Selection of child actors works as expected
#jira UE-28201
Change 2903298 on 2016/03/10 by Simon.Tovey
Disabling the trails optimization.
#tests none
#rb none
#codereview Olaf.Piesche
Change 2903124 on 2016/03/10 by Robert.Manuszewski
Small refactor to pak signing to help with exe protection
#rb none
#tests none
[CL 2907678 by Andrew Grant in Main branch]
293 lines
7.9 KiB
C#
293 lines
7.9 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.IO;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
|
|
[Help("custom code to restructure C++ source code for the new stats system.")]
|
|
class CodeSurgery : BuildCommand
|
|
{
|
|
public override void ExecuteBuild()
|
|
{
|
|
Log("************************* Reworking stats code");
|
|
|
|
var Wildcards = new List<string>() { "*.h", "*.cpp", "*.inl" };
|
|
|
|
// @todo: Add support for STATCAT_
|
|
var DeclareStrings = new List<string>() { "DECLARE_CYCLE_STAT", "DECLARE_FLOAT_COUNTER_STAT", "DECLARE_DWORD_COUNTER_STAT", "DECLARE_FLOAT_ACCUMULATOR_STAT", "DECLARE_DWORD_ACCUMULATOR_STAT", "DECLARE_MEMORY_STAT", "DECLARE_MEMORY_STAT_POOL", "DECLARE_STATS_GROUP" };
|
|
|
|
DirectoryInfo DirInfo = new DirectoryInfo(CmdEnv.LocalRoot);
|
|
var TopLevelDirs = DirInfo.GetDirectories();
|
|
|
|
var Dirs = new List<string>();
|
|
|
|
foreach (var TopLevelDir in TopLevelDirs)
|
|
{
|
|
if (DirectoryExists_NoExceptions(CombinePaths(TopLevelDir.FullName, "Source")))
|
|
{
|
|
Dirs.Add(CombinePaths(TopLevelDir.FullName, "Source"));
|
|
}
|
|
}
|
|
|
|
var AllFiles = new List<string>();
|
|
|
|
foreach (var Dir in Dirs)
|
|
{
|
|
foreach (var Wildcard in Wildcards)
|
|
{
|
|
foreach (var ThisFile in CommandUtils.FindFiles_NoExceptions(Wildcard, true, Dir))
|
|
{
|
|
if (
|
|
!ThisFile.Contains(@"Runtime\Core\Public\Stats\Stats2") &&
|
|
!ThisFile.Contains(@"\ThirdParty\")
|
|
)
|
|
{
|
|
Log("Source File: {0}", ThisFile);
|
|
AllFiles.Add(ThisFile);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var DeclareFiles = new Dictionary<string, string>();
|
|
var DeclareLines = new Dictionary<string, string>();
|
|
var EnumFiles = new Dictionary<string, string>();
|
|
var EnumLines = new Dictionary<string, string>();
|
|
var Broken = new Dictionary<string, string>();
|
|
|
|
|
|
foreach (var ThisFile in AllFiles)
|
|
{
|
|
var FileText = ReadAllText(ThisFile);
|
|
if (FileText.Contains("STAT_") || FileText.Contains("STATGROUP_"))
|
|
{
|
|
var Lines = ReadAllLines(ThisFile);
|
|
foreach (var LineWithWS in Lines)
|
|
{
|
|
var Line = LineWithWS.Trim();
|
|
if (Line.Contains("STAT_") || Line.Contains("STATGROUP_"))
|
|
{
|
|
string TypeString = "STAT_";
|
|
if (!Line.Contains(TypeString) || Line.Contains("DECLARE_STATS_GROUP"))
|
|
{
|
|
TypeString = "STATGROUP_";
|
|
}
|
|
bool bDeclareLine = false;
|
|
foreach (var DeclareString in DeclareStrings)
|
|
{
|
|
if (Line.Contains(DeclareString))
|
|
{
|
|
bDeclareLine = true;
|
|
break;
|
|
}
|
|
}
|
|
var Cut = Line;
|
|
string Exception = "DECLARE_MEMORY_STAT_POOL";
|
|
if (Line.StartsWith(Exception))
|
|
{
|
|
Cut = Line.Substring(Exception.Length);
|
|
}
|
|
Cut = Cut.Substring(Cut.IndexOf(TypeString));
|
|
int End = Cut.IndexOf(",");
|
|
if (End < 0)
|
|
{
|
|
End = Cut.Length;
|
|
}
|
|
int EndEq = Cut.IndexOf("=");
|
|
int EndParen = Cut.IndexOf(")");
|
|
int EndParen2 = Cut.IndexOf("(");
|
|
|
|
if (EndEq > 0 && EndEq < End)
|
|
{
|
|
End = EndEq;
|
|
}
|
|
if (EndParen > 0 && EndParen < End)
|
|
{
|
|
End = EndParen;
|
|
}
|
|
if (EndParen2 > 0 && EndParen2 < End)
|
|
{
|
|
End = EndParen2;
|
|
}
|
|
string StatName = Cut.Substring(0, End).Trim();
|
|
|
|
bool bEnumLine = false;
|
|
if (!bDeclareLine)
|
|
{
|
|
if ((Line.EndsWith(",") || Line == StatName) && Line.StartsWith(TypeString))
|
|
{
|
|
bEnumLine = true;
|
|
}
|
|
}
|
|
|
|
if (bEnumLine || bDeclareLine)
|
|
{
|
|
Log("{0} {1} Line: {2} : {3}", bEnumLine ? "Enum" : "Declare", TypeString, StatName, Line);
|
|
|
|
if (bEnumLine)
|
|
{
|
|
if (EnumFiles.ContainsKey(StatName))
|
|
{
|
|
if (!Broken.ContainsKey(StatName))
|
|
{
|
|
Broken.Add(StatName, Line);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
EnumFiles.Add(StatName, ThisFile);
|
|
EnumLines.Add(StatName, Line);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (DeclareFiles.ContainsKey(StatName))
|
|
{
|
|
if (!Broken.ContainsKey(StatName))
|
|
{
|
|
Broken.Add(StatName, Line);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
DeclareFiles.Add(StatName, ThisFile);
|
|
DeclareLines.Add(StatName, Line);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var AllGoodStats = new List<string>();
|
|
var AllGoodGroups = new List<string>();
|
|
|
|
|
|
foreach (var DeclareLine in DeclareLines)
|
|
{
|
|
if (!Broken.ContainsKey(DeclareLine.Key))
|
|
{
|
|
if (EnumFiles.ContainsKey(DeclareLine.Key))
|
|
{
|
|
if (DeclareLine.Key.StartsWith("STATGROUP_"))
|
|
{
|
|
AllGoodGroups.Add(DeclareLine.Key);
|
|
}
|
|
else
|
|
{
|
|
AllGoodStats.Add(DeclareLine.Key);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Broken.Add(DeclareLine.Key, DeclareLine.Value);
|
|
}
|
|
}
|
|
}
|
|
|
|
var ToCheckOuts = new HashSet<string>();
|
|
Log("Stats *************************");
|
|
foreach (var AllGoodStat in AllGoodStats)
|
|
{
|
|
Log("{0}", AllGoodStat);
|
|
ToCheckOuts.Add(DeclareFiles[AllGoodStat]);
|
|
ToCheckOuts.Add(EnumFiles[AllGoodStat]);
|
|
}
|
|
Log("Groups *************************");
|
|
foreach (var AllGoodGroup in AllGoodGroups)
|
|
{
|
|
Log("{0}", AllGoodGroup);
|
|
ToCheckOuts.Add(DeclareFiles[AllGoodGroup]);
|
|
ToCheckOuts.Add(EnumFiles[AllGoodGroup]);
|
|
}
|
|
Log("Broken *************************");
|
|
foreach (var BrokenItem in Broken)
|
|
{
|
|
Log("{0}", BrokenItem.Key);
|
|
}
|
|
Log("*************************");
|
|
|
|
int WorkingCL = -1;
|
|
if (P4Enabled)
|
|
{
|
|
WorkingCL = P4.CreateChange(P4Env.Client, "Stat code surgery");
|
|
Log("Working in {0}", WorkingCL);
|
|
}
|
|
else
|
|
{
|
|
throw new AutomationException("this command needs to run with P4.");
|
|
}
|
|
|
|
var CheckedOuts = new HashSet<string>();
|
|
foreach (var ToCheckOut in ToCheckOuts)
|
|
{
|
|
if (P4.Edit_NoExceptions(WorkingCL, ToCheckOut))
|
|
{
|
|
CheckedOuts.Add(ToCheckOut);
|
|
}
|
|
}
|
|
Log("Checked Out *************************");
|
|
foreach (var CheckedOut in CheckedOuts)
|
|
{
|
|
Log("{0}", CheckedOut);
|
|
}
|
|
Log("Failed to check out *************************");
|
|
foreach (var ToCheckOut in ToCheckOuts)
|
|
{
|
|
if (!CheckedOuts.Contains(ToCheckOut))
|
|
{
|
|
Log("{0}", ToCheckOut);
|
|
}
|
|
}
|
|
Log("*************************");
|
|
foreach (var AllGoodStat in AllGoodStats)
|
|
{
|
|
if (EnumFiles[AllGoodStat].EndsWith(".cpp", StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
var DeclareFileText = ReadAllText(DeclareFiles[AllGoodStat]);
|
|
DeclareFileText = DeclareFileText.Replace(DeclareLines[AllGoodStat], "");
|
|
WriteAllText(DeclareFiles[AllGoodStat], DeclareFileText);
|
|
|
|
var EnumFileText = ReadAllText(EnumFiles[AllGoodStat]);
|
|
EnumFileText = EnumFileText.Replace(EnumLines[AllGoodStat], DeclareLines[AllGoodStat]);
|
|
WriteAllText(EnumFiles[AllGoodStat], EnumFileText);
|
|
}
|
|
else
|
|
{
|
|
var DeclareFileText = ReadAllText(DeclareFiles[AllGoodStat]);
|
|
DeclareFileText = DeclareFileText.Replace(DeclareLines[AllGoodStat], "DEFINE_STAT(" + AllGoodStat + ");");
|
|
WriteAllText(DeclareFiles[AllGoodStat], DeclareFileText);
|
|
|
|
var EnumFileText = ReadAllText(EnumFiles[AllGoodStat]);
|
|
var ExternDeclare = DeclareLines[AllGoodStat];
|
|
|
|
int Paren = ExternDeclare.IndexOf("(");
|
|
ExternDeclare = ExternDeclare.Substring(0, Paren) + "_EXTERN" + ExternDeclare.Substring(Paren);
|
|
|
|
Paren = ExternDeclare.LastIndexOf(")");
|
|
ExternDeclare = ExternDeclare.Substring(0, Paren) + ", " + ExternDeclare.Substring(Paren);
|
|
|
|
EnumFileText = EnumFileText.Replace(EnumLines[AllGoodStat], ExternDeclare);
|
|
WriteAllText(EnumFiles[AllGoodStat], EnumFileText);
|
|
|
|
}
|
|
}
|
|
foreach (var AllGoodGroup in AllGoodGroups)
|
|
{
|
|
var DeclareFileText = ReadAllText(DeclareFiles[AllGoodGroup]);
|
|
DeclareFileText = DeclareFileText.Replace(DeclareLines[AllGoodGroup], "");
|
|
WriteAllText(DeclareFiles[AllGoodGroup], DeclareFileText);
|
|
|
|
var EnumFileText = ReadAllText(EnumFiles[AllGoodGroup]);
|
|
EnumFileText = EnumFileText.Replace(EnumLines[AllGoodGroup], DeclareLines[AllGoodGroup]);
|
|
WriteAllText(EnumFiles[AllGoodGroup], EnumFileText);
|
|
}
|
|
|
|
Log("*************************");
|
|
|
|
}
|
|
}
|