-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cake
More file actions
65 lines (53 loc) · 1.87 KB
/
build.cake
File metadata and controls
65 lines (53 loc) · 1.87 KB
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
// Target - The task you want to start. Runs the Default task if not specified.
var target = Argument("Target", "Default");
var configuration = Argument("Configuration", "Release");
Information($"Running target {target} in configuration {configuration}");
var PROJECT_DIR = Context.Environment.WorkingDirectory.FullPath + "/";
var BIN_DIR = PROJECT_DIR + "bin/" + configuration + "/";
var SUPPORTED_TEST_PLATFORMS = new [] { "netcoreapp3.1" };
var TEST_ASSEMBLY = "tclite.tests.dll";
// Deletes the contents of the Artifacts folder if it contains anything from a previous build.
Task("Clean")
.Does(() =>
{
CleanDirectory(BIN_DIR);
});
// Run dotnet restore to restore all package references.
Task("Restore")
.Does(() =>
{
DotNetCoreRestore();
});
// Build using the build configuration specified as an argument.
Task("Build")
.Does(() =>
{
DotNetCoreBuild(".",
new DotNetCoreBuildSettings()
{
Configuration = configuration,
ArgumentCustomization = args => args.Append("--no-restore"),
});
});
Task("Test")
.Does(() =>
{
foreach (var platform in SUPPORTED_TEST_PLATFORMS)
StartProcess("dotnet", System.IO.Path.Combine(BIN_DIR + platform, TEST_ASSEMBLY));
});
// A meta-task that runs all the steps to Build and Test the app
Task("BuildAndTest")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Test");
Task("AppVeyor")
.IsDependentOn("BuildAndTest");
Task("Travis")
.IsDependentOn("BuildAndTest");
// The default task to run if none is explicitly specified. In this case, we want
// to run everything starting from Clean, all the way up to Publish.
Task("Default")
.IsDependentOn("BuildAndTest");
// Executes the task specified in the target argument.
RunTarget(target);