forked from opserver/Opserver
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.cake
More file actions
63 lines (54 loc) · 1.88 KB
/
build.cake
File metadata and controls
63 lines (54 loc) · 1.88 KB
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
var target = Argument("target", "Pack");
var configuration = Argument("configuration", "Release");
var version = EnvironmentVariable<string>("VERSION", "1.1.0.0");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectory($"./Opserver/bin/{configuration}");
CleanDirectory($"./Opserver/obj/{configuration}");
CleanDirectory($"./Opserver.Core/bin/{configuration}");
CleanDirectory($"./Opserver.Core/obj/{configuration}");
DeleteFiles("**/*.nupkg");
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var solutions = GetFiles("./Opserver.sln");
foreach(var solution in solutions)
{
Information("Restoring {0}", solution);
NuGetRestore(solution);
}
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
MSBuild("./Opserver.sln", new MSBuildSettings
{
Configuration = configuration,
InformationalVersion = version,
FileVersion = version,
Version = version
});
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
var nuGetPackSettings = new NuGetPackSettings {
RequireLicenseAcceptance = false,
Symbols = false,
Version = version,
OutputDirectory = "./output"
};
NuGetPack("./Opserver/Opserver.nuspec", nuGetPackSettings);
});
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);