This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
forked from ozzymcduff/Cake.SemVer.FromAssembly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.cake
86 lines (75 loc) · 3.14 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
var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory);
var solutionFilePath = "./Source/Cake.SynVer.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.SynVer",
Version = "0.0.2",
Title = "Cake addin to use SynVer",
Authors = new[] {"Oskar Gewalli", "SPISE MISU ApS (Ramón Soto Mathiesen)"},
Owners = new[] {"Oskar Gewalli", "SPISE MISU ApS (Ramón Soto Mathiesen)"},
Description = "Cake addin in order to be able to get next syntactic (semantic) version of nuget package based on changes to the public API",
ProjectUrl = new Uri("https://github.com/fsprojects/Cake.SynVer"),
LicenseUrl = new Uri("https://raw.githubusercontent.com/fsprojects/Cake.SynVer/master/LICENSE"),
IconUrl = new Uri("https://raw.githubusercontent.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png"),
Copyright = "fsprojects 2017",
ReleaseNotes = new string[]{"Initial release"},
Tags = new [] {"semver", "synver", "Cake", "syntactic-versioning", "semantic-versioning"},
RequireLicenseAcceptance= false,
Symbols = true,
NoPackageAnalysis = true,
Files = new [] {
new NuSpecContent {Source = "Cake.SynVer.dll", Target = "/"},
new NuSpecContent {Source = "Cake.SynVer.XML", Target = "/"},
},
Dependencies = new List<NuSpecDependency>
{
new NuSpecDependency { Id= "SynVer", Version="0.0.6"}
},
BasePath = "./Source/Cake.SynVer/bin/" + configuration,
OutputDirectory = "./BuildArtifacts/nuget"
};
NuGetPack(nuGetPackSettings);
});
Task("Default")
.IsDependentOn("Run-xUnit-Tests");
RunTarget(target);