-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpackaging.cake
108 lines (101 loc) · 4.94 KB
/
packaging.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// ***********************************************************************
// Copyright (c) Charlie Poole and contributors.
// Licensed under the MIT License. See LICENSE.txt in root directory.
// ***********************************************************************
using System.Xml;
//////////////////////////////////////////////////////////////////////
// PACKAGE METADATA
//////////////////////////////////////////////////////////////////////
const string TITLE = "NUnit 3 - NUnit V2 Result Writer Extension";
static readonly string[] AUTHORS = new[] { "Charlie Poole" };
static readonly string[] OWNERS = new[] { "Charlie Poole" };
const string DESCRIPTION = "This extension allows NUnit to create result files in the V2 format, which is used by many CI servers.";
const string SUMMARY = "NUnit Engine extension for writing test result files in NUnit V2 format.";
const string COPYRIGHT = "Copyright (c) 2016-2021 Charlie Poole";
static readonly string[] RELEASE_NOTES = new [] { "See https://raw.githubusercontent.com/nunit/nunit-v2-result-writer/main/CHANGES.md" };
static readonly string[] TAGS = new[] { "nunit", "test", "testing", "tdd", "runner" };
static readonly Uri PROJECT_URL = new Uri("http://nunit.org");
static readonly Uri ICON_URL = new Uri("https://cdn.rawgit.com/nunit/resources/master/images/icon/nunit_256.png");
static readonly Uri LICENSE_URL = new Uri("http://nunit.org/nuget/nunit3-license.txt");
const string GITHUB_SITE = "https://github.com/nunit/nunit-v2-result-writer";
const string WIKI_PAGE = "https://github.com/nunit/docs/wiki/Console-Command-Line";
static readonly Uri PROJECT_SOURCE_URL = new Uri(GITHUB_SITE);
static readonly Uri PACKAGE_SOURCE_URL = new Uri(GITHUB_SITE);
static readonly Uri BUG_TRACKER_URL = new Uri(GITHUB_SITE + "/issues");
static readonly Uri DOCS_URL = new Uri(WIKI_PAGE);
static readonly Uri MAILING_LIST_URL = new Uri("https://groups.google.com/forum/#!forum/nunit-discuss");
//////////////////////////////////////////////////////////////////////
// BUILD NUGET PACKAGE
//////////////////////////////////////////////////////////////////////
public void BuildNuGetPackage(BuildParameters parameters)
{
NuGetPack(
new NuGetPackSettings()
{
Id = NUGET_ID,
Version = parameters.PackageVersion,
Title = TITLE,
Authors = AUTHORS,
Owners = OWNERS,
Description = DESCRIPTION,
Summary = SUMMARY,
ProjectUrl = PROJECT_URL,
IconUrl = ICON_URL,
//Icon = "nunit.ico", // Waiting for Cake release
License = new NuSpecLicense() { Type = "expression", Value = "MIT" },
//LicenseUrl = LICENSE_URL,
RequireLicenseAcceptance = false,
Copyright = COPYRIGHT,
ReleaseNotes = RELEASE_NOTES,
Tags = TAGS,
//Language = "en-US",
OutputDirectory = parameters.PackageDirectory,
KeepTemporaryNuSpecFile = false,
Files = new[] {
new NuSpecContent { Source = parameters.ProjectDirectory + "LICENSE.txt" },
new NuSpecContent { Source = parameters.ProjectDirectory + "CHANGES.md" },
new NuSpecContent { Source = parameters.ProjectDirectory + "net20.engine.addins", Target = "tools" },
new NuSpecContent { Source = parameters.OutputDirectory + "net20/nunit-v2-result-writer.dll", Target = "tools/net20" },
new NuSpecContent { Source = parameters.OutputDirectory + "netcoreapp2.1/nunit-v2-result-writer.dll", Target = "tools/netcoreapp2.1" }
}
});
}
//////////////////////////////////////////////////////////////////////
// BUILD CHOCOLATEY PACKAGE
//////////////////////////////////////////////////////////////////////
public void BuildChocolateyPackage(BuildParameters parameters)
{
ChocolateyPack(
new ChocolateyPackSettings()
{
Id = CHOCO_ID,
Version = parameters.PackageVersion,
Title = TITLE,
Authors = AUTHORS,
Owners = OWNERS,
Description = DESCRIPTION,
Summary = SUMMARY,
ProjectUrl = PROJECT_URL,
IconUrl = ICON_URL,
LicenseUrl = LICENSE_URL,
RequireLicenseAcceptance = false,
Copyright = COPYRIGHT,
ProjectSourceUrl = PROJECT_SOURCE_URL,
DocsUrl = DOCS_URL,
BugTrackerUrl = BUG_TRACKER_URL,
PackageSourceUrl = PACKAGE_SOURCE_URL,
MailingListUrl = MAILING_LIST_URL,
ReleaseNotes = RELEASE_NOTES,
Tags = TAGS,
//Language = "en-US",
OutputDirectory = parameters.PackageDirectory,
Files = new[] {
new ChocolateyNuSpecContent { Source = parameters.ProjectDirectory + "LICENSE.txt", Target = "tools" },
new ChocolateyNuSpecContent { Source = parameters.ProjectDirectory + "CHANGES.md", Target = "tools" },
new ChocolateyNuSpecContent { Source = parameters.ProjectDirectory + "VERIFICATION.txt", Target = "tools" },
new ChocolateyNuSpecContent { Source = parameters.ProjectDirectory + "net20.engine.addins", Target = "tools" },
new ChocolateyNuSpecContent { Source = parameters.OutputDirectory + "net20/nunit-v2-result-writer.dll", Target = "tools/net20" },
new ChocolateyNuSpecContent { Source = parameters.OutputDirectory + "netcoreapp2.1/nunit-v2-result-writer.dll", Target = "tools/netcoreapp2.1" }
}
});
}