-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathAnalyzerManagerOptions.cs
38 lines (32 loc) · 1.04 KB
/
AnalyzerManagerOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.IO;
using Buildalyzer.Logging;
using Microsoft.Build.Construction;
using Microsoft.Extensions.Logging;
namespace Buildalyzer;
public class AnalyzerManagerOptions
{
public ILoggerFactory LoggerFactory { get; set; }
/// <summary>
/// A filter that indicates whether a give project should be loaded.
/// Return <c>true</c> to load the project, <c>false</c> to filter it out.
/// </summary>
public Func<ProjectInSolution, bool> ProjectFilter { get; set; }
public TextWriter LogWriter
{
set
{
if (value == null)
{
LoggerFactory = null;
return;
}
LoggerFactory ??= new LoggerFactory();
LoggerFactory.AddProvider(new TextWriterLoggerProvider(value));
}
}
public List<ICompilerOptionsParser> CompilerOptionsParsers { get; set; } = [
CscOptionsParser.Instance,
VbcOptionsParser.Instance,
FscOptionsParser.Instance];
}