forked from cake-contrib/Cake.Recipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cake
52 lines (43 loc) · 1.64 KB
/
setup.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
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cake.Recipe",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Recipe",
appVeyorAccountName: "cakecontrib");
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context);
BuildParameters.Tasks.CleanTask
.IsDependentOn("Generate-Version-File");
Task("Generate-Version-File")
.Does(() => {
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", BuildParameters.Version.SemVersion)
.ToString();
System.IO.File.WriteAllText(
"./Cake.Recipe/Content/version.cake",
buildMetaDataCodeGen
);
});
Task("Run-Local-Integration-Tests")
.IsDependentOn("Default")
.Does(() => {
CakeExecuteScript("./test.cake",
new CakeSettings {
Arguments = new Dictionary<string, string>{
{ "recipe-version", BuildParameters.Version.SemVersion },
{ "verbosity", Context.Log.Verbosity.ToString("F") }
}});
});
Build.RunNuGet();