-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.cake
executable file
·69 lines (62 loc) · 1.88 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var target = Argument("target", "default");
var rootPath = "./";
var srcPath = rootPath + "AElf.Client/";
var testPath = rootPath + "AElf.Client.Test/";
var distPath = rootPath + "aelf-node/";
var solution = rootPath + "all.sln";
var srcProjects = GetFiles(srcPath + "AElf.Client.csproj");
Task("clean")
.Description("clean up project cache")
.Does(() =>
{
DeleteFiles(distPath + "*.nupkg");
CleanDirectories(srcPath + "bin");
CleanDirectories(srcPath + "obj");
CleanDirectories(testPath + "bin");
CleanDirectories(testPath + "obj");
});
Task("restore")
.Description("restore project dependencies")
.Does(() =>
{
var restoreSettings = new DotNetCoreRestoreSettings{
ArgumentCustomization = args => {
return args.Append("-v quiet");}
};
DotNetCoreRestore(solution,restoreSettings);
});
Task("build")
.Description("Compilation project")
.IsDependentOn("clean")
.IsDependentOn("restore")
.Does(() =>
{
var buildSetting = new DotNetCoreBuildSettings{
NoRestore = true,
Configuration = "Debug",
ArgumentCustomization = args => {
return args.Append("/clp:ErrorsOnly")
.Append("--no-incremental")
.Append("-v quiet");}
};
DotNetCoreBuild(solution, buildSetting);
});
Task("test")
.Description("operation test")
.IsDependentOn("build")
.Does(() =>
{
var testSetting = new DotNetCoreTestSettings{
NoRestore = true,
NoBuild = true
};
var testProjects = GetFiles("./*.Test/*.csproj");
foreach(var testProject in testProjects)
{
DotNetCoreTest(testProject.FullPath, testSetting);
}
});
Task("default")
.Description("default run test(-target test)")
.IsDependentOn("build");
RunTarget(target);