forked from seek-oss/seek.automation.phantom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
82 lines (70 loc) · 1.98 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
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var projectName = "seek.automation.phantom";
var projectDescription = "A pact-based service simulator";
var releaseNotes = ParseReleaseNotes("ReleaseNotes.md");
var buildNumber = EnvironmentVariable("BUILD_NUMBER") ?? "0";
var version = string.Format("{0}.{1}", releaseNotes.Version, buildNumber);
Setup(context =>
{
CopyFileToDirectory("tools/nuget.exe", "tools/cake/");
NuGetInstall("xunit.runner.console", new NuGetInstallSettings {
ExcludeVersion = true,
OutputDirectory = "./tools"
});
}
);
Teardown(context =>
{
Information("Completed!");
}
);
Task("Clean")
.Does(() =>
{
CleanDirectories(string.Format("{0}/**/bin", projectName));
CleanDirectories(string.Format("{0}/**/obj", projectName));
}
);
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(string.Format("src/{0}.sln", projectName));
}
);
Task("AssemblyInfo")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
CreateAssemblyInfo(string.Format("src/{0}/Properties/AssemblyInfo.cs", projectName), new AssemblyInfoSettings
{
Title = projectName,
Description = projectDescription,
Guid = "4dd5b14a-ef02-4ce0-9c33-52a4a4ea05f5",
Product = projectName,
Version = version,
FileVersion = version
});
});
Task("Build-Solution")
.IsDependentOn("AssemblyInfo")
.Does(() =>
{
MSBuild(string.Format("src/{0}.sln", projectName), new MSBuildSettings()
.UseToolVersion(MSBuildToolVersion.NET46)
.SetVerbosity(Verbosity.Minimal)
.SetConfiguration(configuration)
);
}
);
Task("Run-Unit-Tests")
.IsDependentOn("Build-Solution")
.Does(() =>
{
XUnit2(string.Format("src/{0}.tests/**/bin/{1}/*.Tests.dll", projectName, configuration));
}
);
Task("Default")
.IsDependentOn("Run-Unit-Tests");
RunTarget(target);