-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBuildContext.cs
58 lines (50 loc) · 2.04 KB
/
BuildContext.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Common.Tools.ReportGenerator;
using Cake.Core;
using Cake.Core.IO;
using Cake.Frosting;
using Nerdbank.GitVersioning;
namespace Build
{
public class BuildContext : FrostingContext
{
public DirectoryPath ReportsFolder { get; }
public DirectoryPath ResultsFolder { get; }
public DirectoryPath PackagesFolder { get; }
public DirectoryPath CoberturaFolder { get; }
public FilePath CoberturaResultFile { get; }
public ReportGeneratorSettings ReportGeneratorSettings { get; }
public VersionOracle? GitVersion { get; internal set; }
public string? Branch { get; internal set; }
public string? Commit { get; internal set; }
public bool TestsAreFailing { get; internal set; }
public bool IsPublicRelease { get; internal set; }
public BuildContext(ICakeContext context)
: base(context)
{
ReportsFolder = this.MakeAbsolute(new DirectoryPath(Constants.ReportsPath));
ResultsFolder = this.MakeAbsolute(new DirectoryPath(Constants.ResultsPath));
PackagesFolder = this.MakeAbsolute(new DirectoryPath(Constants.PackagesPath));
CoberturaFolder = this.MakeAbsolute(new DirectoryPath(Constants.CoberturaPath));
CoberturaResultFile = CoberturaFolder.CombineWithFilePath("Cobertura.xml");
this.Information($"Provider: {this.BuildSystem().Provider}");
this.Information($"Platform: {Environment.Platform.Family} ({(Environment.Platform.Is64Bit ? "x64" : "x86")})");
ReportGeneratorSettings = new ReportGeneratorSettings()
{
AssemblyFilters = new[]
{
"-MonstercatNet.Tests*",
"-nunit3*",
"-refit*"
},
ClassFilters = new[]
{
"-System*",
"-Microsoft*",
}
};
}
}
}