-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
50 lines (39 loc) · 1.16 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
// Add necessary Cake modules and tools
#module nuget:?package=Cake.DotNetTool.Module&version=0.4.0
#tool nuget:?package=NuGet.CommandLine&version=5.11.0
#load "builder/internals_recipes_myawesomecompany_extensions.cake"
var target = Argument("target", "Default");
Task("Clean")
.Does(() =>
{
CleanDirectory("./artifacts");
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
// Restore NuGet packages
DotNetCoreRestore("MyCliApp/MyCliApp.csproj");
});
Task("InstallPackages")
.IsDependentOn("Restore")
.Does(() =>
{
// Add Newtonsoft.Json package
StartProcess("nuget", "install Newtonsoft.Json -OutputDirectory ./packages");
});
Task("Build")
.IsDependentOn("InstallPackages")
.Does(() =>
{
DotNetCoreBuild("MyCliApp/MyCliApp.csproj", new DotNetCoreBuildSettings
{
Configuration = "Release"
});
});
// Define a task that depends on SubTask from subbuild.cake
Task("RunSubTask")
.IsDependentOn("Build");
Task("Default")
.IsDependentOn("Build");
RunTarget(target);