-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.csx
68 lines (58 loc) · 2.8 KB
/
build.csx
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
#r "nuget: Cake.Frosting.PleOps.Recipe, 1.0.1"
using Cake.Core;
using Cake.Frosting;
using Cake.Frosting.PleOps.Recipe;
using Cake.Frosting.PleOps.Recipe.Dotnet;
return new CakeHost()
.AddAssembly(typeof(BuildLifetime).Assembly)
.AddAssembly(typeof(Cake.Frosting.PleOps.Recipe.PleOpsBuildContext).Assembly)
.UseContext<PleOpsBuildContext>()
.UseLifetime<BuildLifetime>()
.Run(Args);
public sealed class BuildLifetime : FrostingLifetime<PleOpsBuildContext>
{
public override void Setup(PleOpsBuildContext context, ISetupContext info)
{
// HERE you can set default values overridable by command-line
context.WarningsAsErrors = false;
context.DotNetContext.CoverageTarget = 0;
context.DotNetContext.ApplicationProjects.Add(new ProjectPublicationInfo(
"./src/PlayMobic.Tool", new[] { "win-x64", "linux-x64", "osx-x64" }, "net8.0"));
context.DotNetContext.ApplicationProjects.Add(new ProjectPublicationInfo(
"./src/PlayMobic.UI", new[] { "win-x64", "linux-x64", "osx-x64" }, "net8.0"));
// Update build parameters from command line arguments.
context.ReadArguments();
// HERE you can force values non-overridable.
context.DotNetContext.PreviewNuGetFeed = "https://pkgs.dev.azure.com/SceneGate/SceneGate/_packaging/SceneGate-Preview/nuget/v3/index.json";
context.DotNetContext.StableNuGetFeed = "https://pkgs.dev.azure.com/SceneGate/SceneGate/_packaging/SceneGate-Preview/nuget/v3/index.json";
// Print the build info to use.
context.Print();
}
public override void Teardown(PleOpsBuildContext context, ITeardownContext info)
{
// Save the info from the existing artifacts for the next execution (e.g. deploy job)
context.DeliveriesContext.Save();
}
}
[TaskName("Default")]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.SetGitVersionTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.CleanArtifactsTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.DotnetTasks.BuildProjectTask))]
public sealed class DefaultTask : FrostingTask
{
}
[TaskName("Bundle")]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.SetGitVersionTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.GitHub.ExportReleaseNotesTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.DotnetTasks.BundleProjectTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.DocFx.BuildTask))]
public sealed class BundleTask : FrostingTask
{
}
[TaskName("Deploy")]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.SetGitVersionTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.DotnetTasks.DeployProjectTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.GitHub.UploadReleaseBinariesTask))]
public sealed class DeployTask : FrostingTask
{
}