Files
UnrealEngineUWP/Engine/Source/Programs/BuildAgent/Issues/Matchers/GenericCodeIssueMatcher.cs
Ben Marsh 2c44a2581a Add functionality for updating build issues into the BuildAgent tool.
#rb none

[CL 9371615 by Ben Marsh in Dev-Build branch]
2019-10-02 11:53:02 -04:00

52 lines
1.4 KiB
C#

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tools.DotNETCommon.Perforce;
namespace BuildAgent.Issues.Matchers
{
/// <summary>
/// Base class for pattern matchers that match errors in source code
/// </summary>
abstract class GenericCodeIssueMatcher : Matcher
{
/// <summary>
/// Set of extensions to treat as code
/// </summary>
static readonly string[] CodeExtensions =
{
".c",
".cc",
".cpp",
".m",
".mm",
".rc",
".cs",
".h",
".hpp",
".inl",
".uproject",
".uplugin",
".ini",
};
/// <summary>
/// Finds any suspected causers for a particular failure. Excludes any changes that don't contain code.
/// </summary>
/// <param name="Perforce">The perforce connection</param>
/// <param name="Issue">The build issue</param>
/// <param name="Changes">List of changes since the issue first occurred.</param>
/// <returns>List of changes which are causers for the issue</returns>
public override List<ChangeInfo> FindCausers(PerforceConnection Perforce, Issue Issue, IReadOnlyList<ChangeInfo> Changes)
{
List<ChangeInfo> Causers = base.FindCausers(Perforce, Issue, Changes);
Causers.RemoveAll(x => !ContainsAnyFileWithExtension(Perforce, x, CodeExtensions));
return Causers;
}
}
}