You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Improvements to BenchmarkBuild script. - Added -editor-startup and -editor-game options to measure startup and startup time with -game - Renamed -pie to -editor-pie to match other editor options- - Allow different editor tests to use different sets of maps via -editor-startup=map2+map2, -editor-pie=map1+map2 etc - Added AllEditor option to run all editor benchmarking - Added -coldddc-noshared DDC option - BenchmarkBuild now defaults to cleaning each targets after benchmarking its build time to save disk space (disable with -nopostclean) - Moved Editor benchmark tests into separate files and reduced some duplicated code - Updated help info Other - Fixed UAT GetProjectProperties returning inaccurate values if called twice with different platforms - Doubled number of UBT logs that can be generated from a single UAT script - Allow scripts to call UnrealBuild.CleanWithUBT to perform cleanup - Simplified a lot of code #rb na #ROBOMERGE-AUTHOR: andrew.grant #ROBOMERGE-SOURCE: CL 21213895 via CL 21213903 via CL 21213910 via CL 21214414 via CL 21214472 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824) [CL 21214930 by andrew grant in ue5-main branch]
132 lines
3.1 KiB
C#
132 lines
3.1 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using AutomationTool;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using EpicGames.Core;
|
|
using UnrealBuildTool;
|
|
using UnrealBuildBase;
|
|
|
|
namespace AutomationTool.Benchmark
|
|
{
|
|
class BenchmarkCookTask : BenchmarkEditorTaskBase
|
|
{
|
|
protected string CookPlatformName;
|
|
|
|
string CookArgs;
|
|
|
|
bool CookAsClient;
|
|
|
|
public BenchmarkCookTask(ProjectTargetInfo InTargetInfo, ProjectTaskOptions InOptions, bool InSkipBuild)
|
|
: base(InTargetInfo, InOptions, InSkipBuild)
|
|
{
|
|
CookArgs = InOptions.Args;
|
|
CookAsClient = InTargetInfo.BuildTargetAsClient;
|
|
|
|
var PlatformToCookPlatform = new Dictionary<UnrealTargetPlatform, string> {
|
|
{ UnrealTargetPlatform.Win64, "WindowsClient" },
|
|
{ UnrealTargetPlatform.Mac, "MacClient" },
|
|
{ UnrealTargetPlatform.Linux, "LinuxClient" },
|
|
{ UnrealTargetPlatform.Android, "Android_ASTCClient" }
|
|
};
|
|
|
|
CookPlatformName = InTargetInfo.TargetPlatform.ToString();
|
|
|
|
if (PlatformToCookPlatform.ContainsKey(InTargetInfo.TargetPlatform))
|
|
{
|
|
CookPlatformName = PlatformToCookPlatform[InTargetInfo.TargetPlatform];
|
|
}
|
|
|
|
TaskName = string.Format("{0} Cook {1}", ProjectName, CookPlatformName);
|
|
}
|
|
|
|
protected override string GetEditorTaskArgs()
|
|
{
|
|
string Arguments = "";
|
|
|
|
if (CookAsClient)
|
|
{
|
|
Arguments += " -client";
|
|
}
|
|
|
|
if (CookArgs.Length > 0)
|
|
{
|
|
Arguments += " " + CookArgs;
|
|
}
|
|
|
|
return Arguments;
|
|
}
|
|
|
|
protected override bool PerformTask()
|
|
{
|
|
string Arguments = GetBasicEditorCommandLine(false);
|
|
// will throw an exception if it fails
|
|
CommandUtils.RunCommandlet(ProjectTarget.ProjectFile, "UnrealEditor-Cmd.exe", "Cook", String.Format("-TargetPlatform={0} {1}", CookPlatformName, Arguments));
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Iterative cooking test
|
|
/// </summary>
|
|
class BenchmarkIterativeCookTask : BenchmarkCookTask
|
|
{
|
|
public BenchmarkIterativeCookTask(ProjectTargetInfo InTargetInfo, ProjectTaskOptions InOptions, bool InSkipBuild)
|
|
: base(InTargetInfo, InOptions, InSkipBuild)
|
|
{
|
|
TaskName = string.Format("{0} Iterative Cook {1}", ProjectName, CookPlatformName);
|
|
}
|
|
|
|
protected override bool PerformPrequisites()
|
|
{
|
|
if (!base.PerformPrequisites())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
DirectoryReference ContentDir = DirectoryReference.Combine(ProjectTarget.ProjectFile.Directory, "Content");
|
|
|
|
var Files = DirectoryReference.EnumerateFiles(ContentDir, "*.uasset", System.IO.SearchOption.AllDirectories);
|
|
|
|
var AssetFile = Files.FirstOrDefault();
|
|
|
|
if (AssetFile == null)
|
|
{
|
|
Log.TraceError("Could not find asset file to touch under {0}", ContentDir);
|
|
return false;
|
|
}
|
|
|
|
FileInfo Fi = AssetFile.ToFileInfo();
|
|
|
|
bool ReadOnly = Fi.IsReadOnly;
|
|
|
|
if (ReadOnly)
|
|
{
|
|
Fi.IsReadOnly = false;
|
|
}
|
|
|
|
Fi.LastWriteTime = DateTime.Now;
|
|
|
|
if (ReadOnly)
|
|
{
|
|
Fi.IsReadOnly = true;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
protected override string GetEditorTaskArgs()
|
|
{
|
|
string Args = base.GetEditorTaskArgs();
|
|
|
|
Args += " -iterate";
|
|
|
|
return Args;
|
|
}
|
|
}
|
|
}
|