-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.cake
76 lines (56 loc) · 1.76 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
72
73
74
75
76
#addin "Cake.FileHelpers"
var TARGET = Argument ("target", Argument ("t", "Default"));
var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999");
var libraries = new Dictionary<string, string> {
{ "..\src\GradientNavigationHeader.sln", "Any" },
};
var BuildAction = new Action<Dictionary<string, string>> (solutions =>
{
foreach (var sln in solutions)
{
// If the platform is Any build regardless
// If the platform is Win and we are running on windows build
// If the platform is Mac and we are running on Mac, build
if ((sln.Value == "Any")
|| (sln.Value == "Win" && IsRunningOnWindows ())
|| (sln.Value == "Mac" && IsRunningOnUnix ()))
{
// Bit of a hack to use nuget3 to restore packages for project.json
if (IsRunningOnWindows ())
{
Information ("RunningOn: {0}", "Windows");
NuGetRestore (sln.Key, new NuGetRestoreSettings
{
ToolPath = "./tools/nuget3.exe"
});
// Windows Phone / Universal projects require not using the amd64 msbuild
MSBuild (sln.Key, c =>
{
c.Configuration = "Release";
c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86;
});
}
else
{
// Mac is easy ;)
NuGetRestore (sln.Key);
DotNetBuild (sln.Key, c => c.Configuration = "Release");
}
}
}
});
Task("Libraries").Does(()=>
{
BuildAction(libraries);
});
//Build the component, which build samples, nugets, and libraries
Task ("Default")
.IsDependentOn("NuGet");
Task ("Clean").Does (() =>
{
//CleanDirectory ("./component/tools/");
CleanDirectories ("./Build/");
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});
RunTarget (TARGET);