-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.cake
87 lines (69 loc) · 1.86 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
using System.Text.RegularExpressions;
var target = Argument("target", "Default");
var config = Argument("config", "Release");
var nunit = Argument("nunit", false);
var output = "./build";
// Parse the version from the assembly info.
var version = ParseAssemblyInfo("./src/SharedAssemblyInfo.cs").AssemblyVersion;
Information("Building version {0} of OrigoDB.", version);
////////////////////////////////////////////////
Task("NuGetRestore")
.Does(() =>
{
NuGetRestore("./src/OrigoDB.sln");
});
Task("Build")
.IsDependentOn("NuGetRestore")
.Does(() =>
{
MSBuild("./src/OrigoDB.sln", settings =>
settings.SetConfiguration(config)
.UseToolVersion(MSBuildToolVersion.VS2012)
.WithTarget("clean")
.WithTarget("build"));
});
Task("NUnitTest")
.IsDependentOn("Build")
.WithCriteria(() => nunit)
.Does(() =>
{
NUnit("./src/*Tests/bin/" + config + "/*.Test.NUnit.dll");
});
Task("Tests")
.IsDependentOn("NUnitTest");
Task("Zip")
.IsDependentOn("Tests")
.Does(() =>
{
//copy stuff to build directory and create a release package
CleanDirectory(output);
var pattern = "src/OrigoDB.*/bin/" + config + "/OrigoDB.Core.???";
CopyFiles(pattern, output);
var root = "./build/";
var outFile = "./build/OrigoDB.Core.binaries." + version + "-" + config + ".zip";
var files = root + "/*";
// Package the bin folder.
Zip(root, outFile);
});
Task("NuGet")
.IsDependentOn("Tests")
.Does(() =>
{
NuGetPack("./OrigoDB.Core.nuspec", new NuGetPackSettings {
Version = version,
Symbols = true
});
});
Task("ApiDocs")
.IsDependentOn("Build")
.Does(() => {
XmlTransform("Documentation.xsl",
@"src\OrigoDB.Core\bin\Release\OrigoDB.Core.XML", output + "/api-docs.html");
});
Task("Default")
.IsDependentOn("Zip")
.IsDependentOn("NuGet")
.IsDependentOn("Tests")
.IsDependentOn("ApiDocs");
////////////////////////////////////////////////
RunTarget(target);