-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.cake
51 lines (44 loc) · 1.08 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
string target = Argument("target", "Build");
Task("Fetch")
.Does(() =>
{
StartProcess("./fetch_protos.sh");
});
Task("Clean")
.ContinueOnError()
.Does(() =>
{
CleanDirectories("./src/**/bin");
CleanDirectories("./src/**/obj");
});
Task("Generate")
.Does(() =>
{
StartProcess("buf", new ProcessSettings{Arguments = "generate protos"});
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Generate")
.Does(() =>
{
var path = "./src/Sdk";
DotNetRestore("./src/Sdk");
DotNetBuild(path, new DotNetBuildSettings { Configuration = "Release" });
});
Task("UnitTests")
.Does(() =>
{
var path = "./src/Sdk.UnitTests";
DotNetRestore(path);
DotNetBuild(path, new DotNetBuildSettings { Configuration = "Release" });
DotNetTest(path + "/Sdk.UnitTests.csproj", new DotNetTestSettings { Configuration = "Release" });
});
Task("Pack")
.IsDependentOn("Clean")
.Does(() =>
{
var path = "./src/Sdk";
DotNetRestore(path);
DotNetPack(path, new DotNetPackSettings() { Configuration = "Release" });
});
RunTarget(target);