forked from jsmarcus/Iconize
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.cake
94 lines (79 loc) · 2.61 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var version = EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? Argument("version", "3.5.4");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var solution = "./src/Iconize.sln";
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./artifacts");
var directoriesToClean = GetDirectories("./**/bin");
CleanDirectories(directoriesToClean);
DeleteDirectories(directoriesToClean, new DeleteDirectorySettings {
Recursive = true,
Force = false
});
var directoriesToClean2 = GetDirectories("./**/obj");
DeleteDirectories(directoriesToClean2, new DeleteDirectorySettings {
Recursive = true,
Force = false
});
//CleanDirectories("./**/bin");
//CleanDirectories("./**/obj");
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
MSBuild(solution, settings => settings
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.SetMSBuildPlatform(MSBuildPlatform.x86)
.SetPlatformTarget(PlatformTarget.MSIL)
.SetMaxCpuCount(0)
.WithTarget("restore"));
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
MSBuild(solution, settings => settings
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.SetMSBuildPlatform(MSBuildPlatform.x86)
.SetPlatformTarget(PlatformTarget.MSIL)
.SetMaxCpuCount(0)
.WithTarget("build"));
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
MSBuild(solution, settings => settings
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.SetMSBuildPlatform(MSBuildPlatform.x86)
.SetPlatformTarget(PlatformTarget.MSIL)
.SetMaxCpuCount(0)
.WithTarget("pack"));
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Pack");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);