-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.cake
78 lines (67 loc) · 2.07 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
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./src/**/bin/*");
CleanDirectories("./src/**/obj/*");
CleanDirectories("./artifacts");
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore(".");
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
DotNetCoreBuild("./src/Code.sln", new DotNetCoreBuildSettings
{
Configuration = configuration
});
});
Task("Test")
.IsDependentOn("Restore")
.Does(() =>
{
DotNetCoreTest("./test/Code.Tests/Code.Tests.csproj", new DotNetCoreTestSettings
{
Configuration = configuration
});
});
Task("Pack")
.IsDependentOn("Test")
.Does(() =>
{
EnsureDirectoryExists("./artifacts");
var nuGetPackSettings = new NuGetPackSettings
{
Authors = new[] { "Shayne van Asperen" },
Owners = new[] { "Shayne van Asperen" },
ProjectUrl = new Uri("https://github.com/shaynevanasperen/Code"),
IconUrl = new Uri("https://raw.githubusercontent.com/shaynevanasperen/Code/master/Code.png"),
LicenseUrl = new Uri("https://github.com/shaynevanasperen/Code/blob/master/LICENSE"),
RequireLicenseAcceptance = false,
DevelopmentDependency = true,
OutputDirectory = "./artifacts"
};
var nuspecFiles = GetFiles("./**/*.nuspec");
NuGetPack(nuspecFiles, nuGetPackSettings);
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Pack");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);