-
Notifications
You must be signed in to change notification settings - Fork 9
/
recipe.cake
49 lines (40 loc) · 1.87 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
#load nuget:?package=Cake.Recipe&version=2.2.1
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Chocolatey.Cake.Recipe",
repositoryOwner: "chocolatey",
repositoryName: "Chocolatey.Cake.Recipe",
appVeyorAccountName: "chocolatey",
nuspecFilePath: "./Chocolatey.Cake.Recipe/Chocolatey.Cake.Recipe.nuspec",
preferredBuildProviderType: BuildProviderType.TeamCity);
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context);
ToolSettings.SetToolPreprocessorDirectives(
gitReleaseManagerTool: "#tool nuget:?package=GitReleaseManager&version=0.17.0",
gitReleaseManagerGlobalTool: "#tool dotnet:?package=GitReleaseManager.Tool&version=0.17.0");
BuildParameters.Tasks.CleanTask
.IsDependentOn("Generate-Version-File");
Task("Generate-Version-File")
.Does<BuildVersion>((context, buildVersion) => {
var buildMetaDataCodeGen = TransformText(@"
public class BuildMetaData
{
public static string Date { get; } = ""<%date%>"";
public static string Version { get; } = ""<%version%>"";
public static string CakeVersion { get; } = ""<%cakeversion%>"";
}",
"<%",
"%>"
)
.WithToken("date", BuildMetaData.Date)
.WithToken("version", buildVersion.SemVersion)
.WithToken("cakeversion", BuildMetaData.CakeVersion)
.ToString();
System.IO.File.WriteAllText(
"./Chocolatey.Cake.Recipe/Content/version.cake",
buildMetaDataCodeGen
);
});
Build.RunNuGet();