-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
93 lines (76 loc) · 2.48 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Coveralls"
#addin "Cake.DocFx"
#tool "nuget:https://api.nuget.org/v3/index.json?package=coveralls.io"
#tool "nuget:https://api.nuget.org/v3/index.json?package=OpenCover"
#tool "nuget:https://api.nuget.org/v3/index.json?package=ReportGenerator"
#tool "docfx.console"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var coverallsToken = Argument("coverallsToken", string.Empty);
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
// Define directories.
var buildDir = Directory(configuration);
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./**/bin/**");
});
Task("Restore-NuGet-Packages")
.Does(() =>
{
DotNetCoreRestore("./Common.sln");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
DotNetCoreBuild("./Common.sln", new DotNetCoreBuildSettings {
Verbosity = DotNetCoreVerbosity.Minimal,
Configuration = configuration
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration,
ArgumentCustomization = args=>args.Append("/p:CollectCoverage=true /p:CoverletOutputFormat=opencover")
};
DotNetCoreTest("Common.Tests/Common.Tests.csproj", settings);
});
Task("Appveyor")
.IsDependentOn("Test")
.Does(() =>
{
CoverallsIo("Common.Tests/coverage.opencover.xml", new CoverallsIoSettings()
{
RepoToken = coverallsToken
});
});
Task("Docs").Does(() =>
{
DocFxMetadata("./Docfx/docfx.json");
DocFxBuild("./Docfx/docfx.json");
});
Task("DocsServe")
.IsDependentOn("Docs")
.Does(() => DocFxServe("./docs"));
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Test");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);