Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/BenchmarkBuild/BenchmarkSingleCompileTask.cs
brandon boswell 338ca5c885 Back out changelist 21213169
#ROBOMERGE-AUTHOR: brandon.boswell
#ROBOMERGE-SOURCE: CL 21213801 via CL 21213879 via CL 21213889 via CL 21214176 via CL 21214241
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21214665 by brandon boswell in ue5-main branch]
2022-07-22 00:13:12 -04: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 EpicGames.Core;
using UnrealBuildTool;
namespace AutomationTool.Benchmark
{
class BenchmarkSingleCompileTask : BenchmarkBuildTask
{
BenchmarkBuildTask PreTask;
FileReference SourceFile;
public BenchmarkSingleCompileTask(FileReference InProjectFile, string InTarget, UnrealTargetPlatform InPlatform, FileReference InSourceFile, BuildOptions InOptions)
: base(InProjectFile, InTarget, InPlatform, InOptions)
{
PreTask = new BenchmarkBuildTask(InProjectFile, 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;
}
}
}