-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
71 lines (56 loc) · 1.5 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
70
71
#tool "nuget:?package=GitVersion.CommandLine&version=4.0.0"
#tool "nuget:?package=vswhere&version=2.6.7"
using static System.IO.Path;
var configuration = Argument("configuration", "Release");
var output = Argument("output", "artifacts");
var platform = Argument("platform", PlatformTarget.x64);
var sln = "src/Ava.sln";
Task("Clean").Does(() =>
{
CleanDirectory(output);
});
Task("Build.MSIL").Does(() =>
{
MSBuild(sln, new MSBuildSettings
{
Configuration = configuration,
PlatformTarget = platform,
Restore = true,
ToolPath = GetFiles(VSWhereLatest() + "/**/MSBuild.exe").FirstOrDefault(),
});
});
Task("Build").Does(() =>
{
MSBuild(sln, new MSBuildSettings
{
Configuration = configuration,
PlatformTarget = platform,
Restore = true,
ToolPath = GetFiles(VSWhereLatest() + "/**/MSBuild.exe").FirstOrDefault(),
}
.WithProperty("runtime", "win10-x64")
);
});
Task("Artifact.App").Does(() =>
{
var bin = Combine(output, $"AVA");
CreateDirectory(bin);
var skipDirs = new [] { "AVA.Core", "MUI", "MUI.UWP" };
foreach (var dir in GetSubDirectories("build/bin/"))
{
var dirName = dir.GetDirectoryName();
if (skipDirs.Contains(dirName)) continue;
Information("SUP: " + dir);
CopyFiles(Combine(dir.FullPath, "x64/Release/net472/**/*"), bin, true);
}
DeleteFiles($"{bin}/**/*.pdb");
DeleteFiles($"{bin}/**/*.winmd");
DeleteFiles($"{bin}/**/*.xml");
});
Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Build")
.IsDependentOn("Artifact.App")
.Does(() => {})
;
RunTarget("Default");