-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
57 lines (49 loc) · 1.29 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
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var versionSuffix = Argument("versionSuffix", (string)null);
Task("Clean")
.Does(() =>
{
CleanDirectory("./artifacts");
});
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore();
DotNetCoreBuild("./*/*/project.json", new DotNetCoreBuildSettings
{
Configuration = configuration,
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var testSettings = new DotNetCoreTestSettings { NoBuild = true, Configuration = configuration };
// Couldn't get 'dotnet-test-xunit' to run on .NET 4.5.1 on Ubuntu
if(IsRunningOnUnix())
{
testSettings.Framework = "netcoreapp1.0";
}
var testProjects = GetFiles("./test/*.Tests/project.json");
foreach(var p in testProjects){
DotNetCoreTest(p.ToString(), testSettings);
}
});
Task("Package")
.IsDependentOn("Test")
.Does(() =>
{
var p = GetFiles("./src/*/project.json").First();
DotNetCorePack(p.ToString(), new DotNetCorePackSettings
{
NoBuild = true,
Configuration = configuration,
VersionSuffix = versionSuffix,
OutputDirectory = "./artifacts",
});
});
Task("Default")
.IsDependentOn("Test");
RunTarget(target);