-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
59 lines (50 loc) · 1.85 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
#addin nuget:?package=Cake.VersionReader&version=5.1.0
var target = Argument("target", "UnitTests");
var configuration = Argument("configuration", "Release");
var solutionFolder = "./";
var kanbanProjectManagementAppFolder = "./src/Kanban Project Management App";
var publishedArtifactsFolder = "./artifacts";
var cleanTask = Task("Clean")
.Does(() => {
CleanDirectory(publishedArtifactsFolder);
});
var restoreTask = Task("Restore")
.Does(() => {
DotNetCoreRestore(solutionFolder);
});
var buildTask = Task("Build")
.IsDependentOn(cleanTask)
.IsDependentOn(restoreTask)
.Does(() => {
DotNetCoreBuild(solutionFolder, new DotNetCoreBuildSettings{
NoRestore = true,
Configuration = configuration
});
});
var unitTestsTask = Task("UnitTests")
.IsDependentOn(buildTask)
.Does(() => {
DotNetCoreTest(solutionFolder, new DotNetCoreTestSettings{
NoRestore = true,
Configuration = configuration,
NoBuild = true,
});
});
var publishAppTask = Task("PublishKanbanProjectManagementApp")
.IsDependentOn(unitTestsTask)
.Does(() => {
DotNetCorePublish(kanbanProjectManagementAppFolder, new DotNetCorePublishSettings{
NoRestore = true,
Configuration = configuration,
NoBuild = true,
OutputDirectory = publishedArtifactsFolder
});
});
Task("CreateKanbanProjectManagementAppReleaseZip")
.IsDependentOn(publishAppTask)
.Does(() => {
var files = GetFiles($"{publishedArtifactsFolder}/*.*");
var version = GetFullVersionNumber($"{publishedArtifactsFolder}/Kanban Project Management App.exe");
Zip(publishedArtifactsFolder, $"{publishedArtifactsFolder}/Kanban.Project.Management.App-{version}-pre-release.zip", files);
});
RunTarget(target);