-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
66 lines (55 loc) · 1.73 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
#addin nuget:?package=Cake.Coverlet
//ARGUMENTS
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var infrBaseDir = Argument("infrBaseDir", "StarWarsKb.Infrastructure");
var backBaseDir = Argument("backBaseDir", "StarWarsKb.Back");
var frontBaseDir = Argument("frontBaseDir", "StarWarsKb.Front");
//PREPARATION
//TASKS
Task("CleanAllOutputDirs")
.Does(() =>
{
CleanDirectory($"./{infrBaseDir}/bin/{configuration}");
Information($"clean {infrBaseDir} output dir");
CleanDirectory($"./{backBaseDir}/bin/{configuration}");
Information($"clean {backBaseDir} output dir");
CleanDirectory($"./{frontBaseDir}/bin/{configuration}");
Information($"clean {frontBaseDir} output dir");
});
Task("ReleaseBuildAll")
.IsDependentOn("CleanAllOutputDirs")
.Does(()=>
{
DotNetCoreBuild("./StarWarsKb.sln", new DotNetCoreBuildSettings
{
Configuration = configuration,
});
});
Task("Test")
.IsDependentOn("ReleaseBuildAll")
.Does(() =>
{
DotNetTest("./StarWarsKb.sln", new DotNetCoreTestSettings
{
Configuration = configuration,
NoBuild = true,
});
});
Task("TestCoverage")
.IsDependentOn("Test")
.Does(() =>
{
var testSettings = new DotNetCoreTestSettings {
Configuration = configuration,
NoBuild = true,
};
var coverletSettings = new CoverletSettings {
CollectCoverage = true,
CoverletOutputFormat = CoverletOutputFormat.opencover,
CoverletOutputDirectory = Directory(@".\coverage-results\"),
CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}",
};
DotNetCoreTest("./StarWarsKb.sln", testSettings, coverletSettings);
});
RunTarget(target);