Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/BuildGraph/Tasks/CookTask.cs
Andrew Grant 0b4257e23a Copying //UE4/Orion-Staging to //UE4/Main (Source //Orion/Dev-General @ 2927258)
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 2927181 on 2016/03/29 by Dmitry.Rekman

	(Optionally) exclude idle time from server FPS charts.

	- Time spent waiting for the next frame in order to hit capped FPS can be optionally excluded by using t.FPSChart.ExcludeIdleTime (set to 1 for servers).
	- Server FPS charts analytics events and log output will include the information if idle time was excluded.

	- Also: added a log line each time we detect a server hitch for easier pin-pointing them in the log.

	#rb Paul.Moore
	#codereview Paul.Moore, Michael.Noland
	#tests Ran Linux server and Windows client on compatible content.

Change 2927084 on 2016/03/29 by Ben.Marsh

	BuildGraph: Don't allow triggers to run until all their order dependencies are complete. Just because a downstream node doesn't have a dependency on an upstream node via temp storage doesn't mean it can run immediately.

	#rb none
	#tests none

Change 2927060 on 2016/03/29 by Michael.Noland

	Renamed GPU analytics event from GPU to DesktopGPU to reflect that it is the default desktop adapter and not the one we initialized (which is GPUAdapter)
	Updated text/log based FPS chart events to print out GPUAdapter instead (with DesktopGPU in parens if they differ, e.g., in an optimus setup)
	#rb marcus.wassmer
	#tests Ran and did some fps charts

Change 2927048 on 2016/03/29 by Michael.Noland

	HLOD: Removed an unused cvar r.HLODEnabled (everything is done thru r.HLOD)
	#tests Compiled and ran Paragon
	#rb marcus.wassmer

Change 2926920 on 2016/03/29 by Ben.Marsh

	BuildGraph: Update schema with Rename task.

Change 2926911 on 2016/03/29 by Ben.Marsh

	BuildGraph: Add a task which can rename files matching a given wildcard. Syntax is: <Rename Files="*.txt" To="*.md"> or <Rename Files="Engine/Build/..." From="*.txt" To="*.md"/>

	#rb none
	#tests none

Change 2926908 on 2016/03/29 by Andrew.Grant

	Fix for CDO properties of renamed blueprints not being applied
	#rb none
	#tests loaded Origin map (renamed from Playgo3) and verified properties are applied.

Change 2926799 on 2016/03/29 by Jason.Bestimt

	#ORION_DG - Merge MAIN (23) @ CL# 2926780

	#RB:none
	#Tests:none

Change 2926663 on 2016/03/29 by david.nikdel

	#ROBOMERGE-OBO: jason.bestimt
	#ROBOMERGE-SOURCE: CL 2926660 in //Orion/Release-0.23/... via CL 2926662
	#ROBOMERGE-BOT: ORION (Main -> Dev-General)

	#ORION_23 - Potential fix for Cook failures

	"Fix shelved in 2926635, tested in Dev-Blueprints. Could not run any GEditor related logic safely in ShutdownModule because of the same destruction issue orders that caused the bug in the first place. I will chat with Editor team about nulling out GEditor the same way we null out GUnrealEd."

	#RB:none
	#Tests: none

	[CodeReviewed]: andrew.grant, dan.oconnor

Change 2926510 on 2016/03/29 by Andrew.Grant

	Potential fix for OR-18207 - editor becomes unresponsive (audio deadlock)
	#rb none
	#tests compiled

Change 2926495 on 2016/03/29 by Rob.Cannaday

	Change storing HTTP requests as raw pointers to weak pointers with validity being checked via Pinning it
	#jira FORT-18947
	#jira OR-17695
	#tests golden path
	#rb eric.newman

Change 2926427 on 2016/03/29 by Josh.Markiewicz

	#UE4 - fixed typo
	#rb none
	#tests none

Change 2926250 on 2016/03/29 by Martin.Mittring

	fixed OR-18489 HERO: IGGY: RMB on E ability causes blinding hair effect
	#rb:Chris.Bunner
	#codereview:Brian.Karis

Change 2926224 on 2016/03/29 by Daniel.Lamb

	Fix for potenital threading issue with Console manager removing vars which could cause double free.
	#rb Robert.Manuszewski
	#test Orion cook

Change 2926174 on 2016/03/29 by Gareth.Martin

	Cloned fix for bUseMaterialPositionOffsetInStaticLighting crashing across from //UE4/Dev-Landscape/ to unblock people
	#rb
	#tests editor

Change 2925968 on 2016/03/29 by David.Nikdel

	#MCP #OSS
	- Read RedirectUrl from ini

	#RB: Eric.Newman
	#TESTS: compiled in another branch (merge over)
	#ROBOMERGE: Main

[CL 2929424 by Andrew Grant in Main branch]
2016-03-31 15:18:30 -04:00

127 lines
3.8 KiB
C#

using AutomationTool;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnrealBuildTool;
namespace BuildGraph.Tasks
{
/// <summary>
/// Parameters for a task that runs the cooker
/// </summary>
public class CookTaskParameters
{
/// <summary>
/// Project file to be cooked
/// </summary>
[TaskParameter]
public string Project;
/// <summary>
/// The cook platform to target (eg. WindowsNoEditor)
/// </summary>
[TaskParameter]
public string Platform;
/// <summary>
/// List of maps to be cooked, separated by '+' characters
/// </summary>
[TaskParameter(Optional = true)]
public string Maps;
/// <summary>
/// Additional arguments to be passed to the cooker
/// </summary>
[TaskParameter(Optional = true)]
public bool Versioned = false;
/// <summary>
/// Additional arguments to be passed to the cooker
/// </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("Cook", typeof(CookTaskParameters))]
public class CookTask : CustomTask
{
/// <summary>
/// Parameters for the task
/// </summary>
CookTaskParameters Parameters;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="InParameters">Parameters for this task</param>
public CookTask(CookTaskParameters 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)
{
// Figure out the project that this target belongs to
FileReference ProjectFile = null;
if(Parameters.Project != null)
{
ProjectFile = new FileReference(Parameters.Project);
if(!ProjectFile.Exists())
{
CommandUtils.LogError("Missing project file - {0}", ProjectFile.FullName);
return false;
}
}
// Execute the cooker
using(TelemetryStopwatch CookStopwatch = new TelemetryStopwatch("Cook.{0}.{1}", (ProjectFile == null)? "UE4" : ProjectFile.GetFileNameWithoutExtension(), Parameters.Platform))
{
string[] Maps = (Parameters.Maps == null)? null : Parameters.Maps.Split(new char[]{ '+' });
CommandUtils.CookCommandlet(ProjectFile, "UE4Editor-Cmd.exe", Maps, null, null, null, Parameters.Platform, (Parameters.Versioned? "" : "-Unversioned ") + Parameters.Arguments);
}
// Find all the cooked files
DirectoryReference CookedDirectory = DirectoryReference.Combine(ProjectFile.Directory, "Saved", "Cooked", Parameters.Platform);
if(!CookedDirectory.Exists())
{
CommandUtils.LogError("Cook output directory not found ({0})", CookedDirectory.FullName);
return false;
}
List<FileReference> CookedFiles = CookedDirectory.EnumerateFileReferences("*", System.IO.SearchOption.AllDirectories).ToList();
if(CookedFiles.Count == 0)
{
CommandUtils.LogError("Cooking did not produce any files in {0}", CookedDirectory.FullName);
return false;
}
// Apply the optional tag to the build products
if(!String.IsNullOrEmpty(Parameters.Tag))
{
FindOrAddTagSet(TagNameToFileSet, Parameters.Tag).UnionWith(CookedFiles);
}
// Add them to the set of build products
BuildProducts.UnionWith(CookedFiles);
return true;
}
}
}