-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrecipe.cake
69 lines (54 loc) · 3.21 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#load nuget:?package=Chocolatey.Cake.Recipe&version=0.28.4
///////////////////////////////////////////////////////////////////////////////
// SCRIPT
///////////////////////////////////////////////////////////////////////////////
Func<FilePathCollection> getFilesToSign = () =>
{
var filesToSign = GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/app/checksum.exe");
Information("The following assemblies have been selected to be signed...");
foreach (var fileToSign in filesToSign)
{
Information(fileToSign.FullPath);
}
return filesToSign;
};
///////////////////////////////////////////////////////////////////////////////
// CUSTOM TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Prepare-Chocolatey-Packages")
.IsDependeeOf("Create-Chocolatey-Packages")
.IsDependeeOf("Sign-PowerShellScripts")
.IsDependeeOf("Sign-Assemblies")
.WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping because not running on Windows")
.WithCriteria(() => BuildParameters.ShouldRunChocolatey, "Skipping because execution of Chocolatey has been disabled")
.Does(() =>
{
CleanDirectory(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/app");
// Copy legal documents
CopyFile(BuildParameters.RootDirectoryPath + "/LICENSE", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/legal/LICENSE.txt");
// Copy main file
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/checksum/checksum.exe", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/app/checksum.exe");
});
///////////////////////////////////////////////////////////////////////////////
// RECIPE SCRIPT
///////////////////////////////////////////////////////////////////////////////
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
solutionFilePath: "./src/checksum.sln",
solutionDirectoryPath: "./src/checksum",
resharperSettingsFileName: "checksum.sln.DotSettings",
title: "Checksum",
repositoryOwner: "chocolatey",
repositoryName: "checksum",
productName: "Checksum",
productDescription: "chocolatey is a product of Chocolatey Software, Inc. - All Rights Reserved.",
productCopyright: string.Format("Copyright © 2017 - {0} Chocolatey Software, Inc. Copyright © 2011 - 2017, RealDimensions Software, LLC - All Rights Reserved.", DateTime.Now.Year),
shouldStrongNameSignDependentAssemblies: false,
treatWarningsAsErrors: false,
shouldPublishAwsLambdas: false,
getFilesToSign: getFilesToSign);
ToolSettings.SetToolSettings(context: Context);
BuildParameters.PrintParameters(Context);
Build.Run();