-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.cake
55 lines (44 loc) · 1.53 KB
/
build.cake
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
#tool nuget:?package=ReportGenerator&version=5.0.2
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Build")
.Does(() =>
{
DotNetBuild("HandlingErrors.sln");
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
if (System.IO.Directory.Exists("testresults"))
System.IO.Directory.Delete("testresults", true);
var settings = new DotNetTestSettings
{
NoRestore = true,
ArgumentCustomization = x => x.Append("--collect:\"XPlat Code Coverage\""),
Verbosity = DotNetVerbosity.Quiet
};
DotNetTest("HandlingErrors.sln", settings);
});
Task("Coverage")
.IsDependentOn("Test")
.Does(() =>
{
if (System.IO.Directory.Exists("coverage"))
System.IO.Directory.Delete("coverage", true);
GlobPattern coverageFiles = "./tests/**/*.cobertura.xml";
ReportGenerator(coverageFiles, "./coverage", new ReportGeneratorSettings { ReportTypes = new []
{
ReportGeneratorReportType.TextSummary,
ReportGeneratorReportType.lcov,
ReportGeneratorReportType.Cobertura,
ReportGeneratorReportType.HtmlInline_AzurePipelines_Dark
}});
});
RunTarget(target);