This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecipe.cake
58 lines (48 loc) · 1.97 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
#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: "Rocket.Surgery.Xamarin.Recipe",
repositoryOwner: "RocketSurgeonsGuild",
repositoryName: "Xamarin.Recipe",
appVeyorAccountName: "RocketSurgeonsGuild",
masterBranchName: "main",
developBranchName: "dev",
nuspecFilePath: "./Xamarin.Recipe/Rocket.Surgery.Xamarin.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(
"./Xamarin.Recipe/Content/version.cake",
buildMetaDataCodeGen
);
});
Task("UploadAzureDevOpsArtifacts")
.WithCriteria(() => TFBuild.IsRunningOnVSTS)
.Does(() =>
{
BuildSystem
.TFBuild
.Commands
.UploadArtifactDirectory(BuildParameters.Paths.Directories.NuGetPackages.MakeAbsolute(Context.Environment).FullPath, "Packages");
});
Task("AzureDevOps")
.IsDependentOn("Publish-MyGet-Packages")
.IsDependentOn("UploadAzureDevOpsArtifacts");
Build.RunNuGet();