Files
UnrealEngineUWP/Engine/Source/Programs/BuildAgent/Issues/Matchers/GenericCodeIssueMatcher.cs
Ryan Durand 9ef3748747 Updating copyrights for Engine Programs.
#rnx
#rb none
#jira none

#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869242 in //Fortnite/Release-12.00/... via CL 10869536
#ROBOMERGE-BOT: FORTNITE (Main -> Dev-EngineMerge) (v613-10869866)

[CL 10870955 by Ryan Durand in Main branch]
2019-12-26 23:01:54 -05:00

52 lines
1.4 KiB
C#

// Copyright 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;
}
}
}