-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.cake
66 lines (57 loc) · 1.32 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
#tool nuget:?package=xunit.runner.console&version=2.4.1
var target = Argument("target", "Default");
Task("NuGetRestore")
.Does(() =>
{
// this hack is needed until 'dotnet restore' supports restoring
// packages in mixed (.NET and .NET Core) solutions
var projectFiles = GetFiles("./**/packages.config");
var nugetOptions = new NuGetRestoreSettings{
PackagesDirectory = "./packages"
};
foreach(var file in projectFiles)
{
if(file.FullPath.Contains("tools"))
{
continue;
}
NuGetRestore(file.FullPath, nugetOptions);
}
// 'dotnet restore'
DotNetCoreRestore();
});
Task("DotNetBuild")
.IsDependentOn("NuGetRestore")
.Does(() =>
{
// 'dotnet build'
DotNetCoreBuild("./LightCore.sln", new DotNetCoreBuildSettings{
Configuration = "Release"
});
});
Task("DotNetTest")
.IsDependentOn("DotNetBuild")
.Does(() => {
var settings = new DotNetCoreTestSettings
{
Configuration = "Release"
};
var projectFiles = GetFiles("./*.Tests/**/*.Tests.csproj");
foreach(var file in projectFiles)
{
// 'dotnet test'
DotNetCoreTest(file.FullPath, settings);
}
});
Task("DotNetPack")
.IsDependentOn("DotNetTest")
.Does(() => {
// comming soon
});
Task("Default")
.IsDependentOn("DotNetPack")
.Does(() =>
{
Information("Your build is done! :-)");
});
RunTarget(target);