-
Notifications
You must be signed in to change notification settings - Fork 63
/
build.cake
44 lines (36 loc) · 1009 Bytes
/
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
#tool nuget:?package=xunit.runner.console&version=2.3.0
#tool nuget:?package=xunit.runner.visualstudio&version=2.3.0
#load cake/paths.cake
var target = Argument("Target", "Default");
var configuration = Argument("Configuration", "Release");
Task("Restore")
.Does(() =>
{
NuGetRestore(Paths.SolutionFile);
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
MSBuild(
Paths.SolutionFile,
settings => settings.SetConfiguration(configuration)
.WithTarget("Build"));
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./test/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTool(
projectPath: project.FullPath,
command: "xunit",
arguments: $"-configuration {configuration} -diagnostics -stoponfail"
);
}
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target);