Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/BenchmarkBuild/BenchmarkSingleCompileTask.cs
andrew grant f7161586b1 Editgrating benchmark build script from UE4/Main
#ROBOMERGE-SOURCE: CL 11576916 via CL 11576921 via CL 11576922 via CL 11576924
#ROBOMERGE-BOT: (v654-11333218)

[CL 11576925 by andrew grant in Main branch]
2020-02-21 13:09:10 -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;
TaskModifiers.Add("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;
}
}
}