-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathbuild.cake
More file actions
109 lines (97 loc) · 3.9 KB
/
build.cake
File metadata and controls
109 lines (97 loc) · 3.9 KB
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
109
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Test");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var slnFile = "./src/FlaUInspect.sln";
var artifactDir = new DirectoryPath("artifacts");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.WithCriteria(c => HasArgument("rebuild"))
.Does(() =>
{
CleanDirectory($"./src/FlaUInspect/bin/{configuration}");
});
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetBuild(slnFile, new DotNetBuildSettings
{
Configuration = configuration,
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
DotNetTest(slnFile, new DotNetTestSettings
{
Configuration = configuration,
NoBuild = true,
});
});
Task("Package")
.IsDependentOn("Test")
.Does(() =>
{
var version = "2.0.0";
var chocolateyPackSettings = new ChocolateyPackSettings
{
Id = "FlaUInspect" + (configuration != "Debug" ? $".{configuration.ToUpper()}" : ""),
Title = "FlaUI Inspector" + (configuration != "Debug" ? $" {configuration.ToUpper()}" : ""),
Version = version,
Authors = new[] { "Roemer", "K. Usenko {kDg}" },
Owners = new[] { "Roemer", "K. Usenko {kDg}" },
Summary = "Inspect and analyze UI Automation elements in Windows applications.",
Description = "FlaUInspect is a UI Automation inspection tool for Windows applications, useful for accessibility and automation testing.",
ProjectUrl = new Uri("https://github.com/FlaUI/FlaUInspect"),
PackageSourceUrl = new Uri("https://github.com/FlaUI/FlaUInspect"),
ProjectSourceUrl = new Uri("https://github.com/FlaUI/FlaUInspect"),
DocsUrl = new Uri("https://github.com/FlaUI/FlaUInspect/wiki"),
BugTrackerUrl = new Uri("https://github.com/FlaUI/FlaUInspect/issues"),
Tags = new[] { "ui", "automation", "uia", "uia2", "uia3", "system.windows.automation", "inspect", "uiautomation", "accessibility", "windows", "testing" },
Copyright = $"Copyright 2016-{DateTime.Now.Year}",
LicenseUrl = new Uri("https://github.com/FlaUI/FlaUInspect/blob/main/LICENSE"),
RequireLicenseAcceptance = false,
IconUrl = new Uri("https://github.com/FlaUI/FlaUInspect/blob/main/FlaUInspect.png"),
ReleaseNotes = new[] { "https://github.com/FlaUI/FlaUInspect/blob/main/CHANGELOG.md" },
Files = new[] {
new ChocolateyNuSpecContent {
Source = @$"src\FlaUInspect\bin\{configuration}\net8.0-windows10.0.19041.0\**", Target = "tools"
},
new ChocolateyNuSpecContent {
Source = "LICENSE", Target = @"tools\LICENSE"
},
new ChocolateyNuSpecContent {
Source = "CHANGELOG.md", Target = @"tools\CHANGELOG.md"
},
new ChocolateyNuSpecContent {
Source = "VERIFICATION", Target = @"tools\VERIFICATION"
}
},
OutputDirectory = artifactDir
};
ChocolateyPack(chocolateyPackSettings);
});
Task("Push-Package")
.Does(() =>
{
var apiKey = System.IO.File.ReadAllText(".chocoapikey");
var files = GetFiles($"{artifactDir}/*.nupkg");
foreach (var package in files) {
Information($"Pushing {package}");
ChocolateyPush(package, new ChocolateyPushSettings {
ApiKey = apiKey
});
}
});
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);