Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/BenchmarkBuild/BenchmarkSingleCompileTask.cs
andrew grant 03617b67df Integrated scripts for doing simple benchmarking of build steps from Private-Profiling.
Also includes -noshaderddc option for emulating a cold DDC for shaders only.


#rb na
#ROBOMERGE-OWNER: andrew.grant
#ROBOMERGE-AUTHOR: andrew.grant
#ROBOMERGE-SOURCE: CL 11519411 via CL 11519529 via CL 11519553
#ROBOMERGE-BOT: (v654-11333218)

[CL 11524747 by andrew grant in Main branch]
2020-02-18 17:19:54 -05:00

58 lines
1.2 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 Tools.DotNETCommon;
using UnrealBuildTool;
namespace AutomationTool.Benchmark
{
class BenchmarkSingleCompileTask : BenchmarkBuildTask
{
BenchmarkBuildTask PreTask;
FileReference SourceFile;
public BenchmarkSingleCompileTask(string InProject, string InTarget, UnrealTargetPlatform InPlatform, FileReference InSourceFile, BuildOptions InOptions)
: base(InProject, InTarget, InPlatform, InOptions)
{
PreTask = new BenchmarkBuildTask(InProject, InTarget, InPlatform, InOptions);
SourceFile = InSourceFile;
TaskName = TaskName + " (singlecompile)";
}
protected override bool PerformPrequisites()
{
if (!base.PerformPrequisites())
{
return false;
}
PreTask.Run();
FileInfo Fi = SourceFile.ToFileInfo();
bool ReadOnly = Fi.IsReadOnly;
if (ReadOnly)
{
Fi.IsReadOnly = false;
}
Fi.LastWriteTime = DateTime.Now;
if (ReadOnly)
{
Fi.IsReadOnly = true;
}
return !PreTask.Failed;
}
}
}