forked from cake-contrib/Cake.Issues.Recipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipe.cake
69 lines (57 loc) · 2.51 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:https://pkgs.dev.azure.com/cake-contrib/Home/_packaging/addins/nuget/v3/index.json?package=Cake.Recipe&version=4.0.0-alpha0126
//*************************************************************************************************
// Settings
//*************************************************************************************************
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./Cake.Frosting.Issues.Recipe",
title: "Cake.Issues.Recipe",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Issues.Recipe",
appVeyorAccountName: "cakecontrib",
solutionFilePath: "./Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.sln",
shouldRunInspectCode: false, // Currently failing on AppVeyor since .NET 9 update
shouldRunDotNetCorePack: true,
shouldGenerateDocumentation: false);
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context);
//*************************************************************************************************
// Extensions
//*************************************************************************************************
Task("Generate-Version-File")
.Does<BuildVersion>((context, buildVersion) => {
// Write metadata to configuration file
System.IO.File.WriteAllText(
"./Cake.Issues.Recipe/cake-version.yml",
@"TargetCakeVersion: 5.0.0
TargetFrameworks:
- net8.0
- net9.0"
);
// Write metadata to class for use when running a build
var buildMetaDataCodeGen =
TransformText(@"
public class BuildMetaDataCakeIssuesRecipe
{
public static string Date { get; } = ""<%date%>"";
public static string Version { get; } = ""<%version%>"";
}",
"<%",
"%>"
)
.WithToken("date", BuildMetaData.Date)
.WithToken("version", buildVersion.SemVersion)
.ToString();
System.IO.File.WriteAllText(
"./Cake.Issues.Recipe/Content/version.cake",
buildMetaDataCodeGen
);
});
BuildParameters.Tasks.CleanTask
.IsDependentOn("Generate-Version-File");
//*************************************************************************************************
// Execution
//*************************************************************************************************
Build.RunDotNetCore();