This repository has been archived by the owner on Dec 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.cake
88 lines (77 loc) · 3.07 KB
/
setup.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
var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory);
var solutionFilePath = "./Source/Cake.SemVer.FromAssembly.sln";
#tool nuget:?package=xunit.runner.console
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
Task("NuGet-Package-Restore")
.Does(() =>
{
NuGetRestore(solutionFilePath);
});
Task("Build")
.IsDependentOn("NuGet-Package-Restore")
.Does(() =>
{
MSBuild(solutionFilePath, new MSBuildSettings()
.SetConfiguration(configuration)
.WithProperty("Windows", "True")
.WithProperty("TreatWarningsAsErrors", "False")
.UseToolVersion(MSBuildToolVersion.VS2015)
.SetVerbosity(Verbosity.Minimal)
.SetNodeReuse(false));
});
Task("Clean")
.Does(() =>
{
CleanDirectories(new[] { "./BuildArtifacts/TestResults", "./BuildArtifacts/nuget" });
});
Task("Run-xUnit-Tests")
.IsDependentOn("Build")
.IsDependentOn("Clean")
.Does(() =>
{
XUnit2("./Source/**/bin/" + configuration + "/*Tests.dll", new XUnit2Settings {
OutputDirectory = "./BuildArtifacts/TestResults",
XmlReportV1 = true,
NoAppDomain = true
});
});
Task("Package")
.IsDependentOn("Build")
.IsDependentOn("Clean")
.Does(() =>
{
var nuGetPackSettings = new NuGetPackSettings {
Id = "Cake.SemVer.FromBinary",
Version = "0.0.4",
Title = "Cake addin to use SemVer.FromAssembly",
Authors = new[] {"Oskar Gewalli"},
Owners = new[] {"Oskar Gewalli"},
Description = "Cake addin in order to be able to get next semver version of nuget package based on changes to the public API",
ProjectUrl = new Uri("https://github.com/wallymathieu/Cake.SemVer.FromAssembly"),
LicenseUrl = new Uri("https://raw.githubusercontent.com/wallymathieu/Cake.SemVer.FromAssembly/master/LICENSE"),
Copyright = "wallymathieu 2016",
ReleaseNotes = new string[]{"Should reference SemVer.FromAssembly"},
Tags = new [] {"semver", "Cake"},
RequireLicenseAcceptance= false,
Symbols = true,
NoPackageAnalysis = true,
Files = new [] {
new NuSpecContent {Source = "Cake.SemVer.FromBinary.dll", Target = "/"},
new NuSpecContent {Source = "Cake.SemVer.FromBinary.XML", Target = "/"},
},
Dependencies = new List<NuSpecDependency>
{
new NuSpecDependency { Id= "SynVer", Version="0.0.6"}
},
BasePath = "./Source/Cake.SemVer.FromAssembly/bin/" + configuration,
OutputDirectory = "./BuildArtifacts/nuget"
};
NuGetPack(nuGetPackSettings);
nuGetPackSettings.Id = "Cake.SemVer.FromAssembly";
nuGetPackSettings.Version = "0.0.5";
NuGetPack(nuGetPackSettings);
});
Task("Default")
.IsDependentOn("Run-xUnit-Tests");
RunTarget(target);