-
Notifications
You must be signed in to change notification settings - Fork 16
/
recipe.cake
49 lines (42 loc) · 2.2 KB
/
recipe.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
#tool dotnet:?package=DPI&version=2021.12.8.49
#load nuget:https://pkgs.dev.azure.com/cake-contrib/Home/_packaging/addins/nuget/v3/index.json?package=Cake.Recipe&version=4.0.0-alpha0126
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cake.Slack",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Slack",
appVeyorAccountName: "cakecontrib",
shouldRunInspectCode: false);
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context);
Task("DPI")
.IsDependeeOf("DotNetCore-Build")
.Does<BuildVersion>(
(context, buildVersion) => {
var result = context.StartProcess(
context.Tools.Resolve("dpi") ?? context.Tools.Resolve("dpi.exe"),
new ProcessSettings {
Arguments = new ProcessArgumentBuilder()
.Append("nuget")
.Append("--silent")
.AppendSwitchQuoted("--output", "table")
.Append(
(
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_SharedKey"))
&&
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_WorkspaceId"))
)
? "report"
: "analyze"
)
.AppendSwitchQuoted("--buildversion", buildVersion.SemVersion)
}
);
if (result != 0)
{
throw new Exception($"Failed to execute DPI ({result}");
}
});
Build.RunDotNetCore();