-
Notifications
You must be signed in to change notification settings - Fork 6
/
recipe.cake
42 lines (34 loc) · 1.36 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
#load nuget:?package=Cake.Recipe&version=2.1.0
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
nuspecFilePath: "Cake.VsCode.Recipe/Cake.VsCode.Recipe.nuspec",
title: "Cake.VsCode.Recipe",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.VsCode.Recipe",
appVeyorAccountName: "cakecontrib");
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context);
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%>"";
}",
"<%",
"%>"
)
.WithToken("date", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"))
.WithToken("version", buildVersion.SemVersion)
.ToString();
System.IO.File.WriteAllText(
"./Cake.VsCode.Recipe/Content/version.cake",
buildMetaDataCodeGen
);
});
Build.RunNuGet();