-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
64 lines (52 loc) · 1.79 KB
/
build.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
//#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
#load nuget:?package=Cake.Recipe&version=1.1.0
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./Source",
title: "Anori.Cake.Recipe",
// forcePublishNuGet: true,
repositoryOwner: "anorisoft",
repositoryName: "Cake.Recipe",
appVeyorAccountName: "anorisoft",
shouldRunGitVersion: true,
nuspecFilePath: "./Source/Anori.Cake.Recipe/Anori.Cake.Recipe.nuspec"
);
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(
"./Source/Anori.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") }
// }});
//});
//BuildParameters.Tasks.PackageTask
// .IsDependentOn("Publish-Nuget-Packages")
// .Does(() => {});
Build.RunNuGet();