forked from jonathanpeppers/glidex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
74 lines (62 loc) · 1.73 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
#addin nuget:?package=Cake.Boots&version=1.1.0.682-preview1
#load "helpers.cake"
// Input args
string target = Argument("target", "Default");
string configuration = Argument("configuration", "Release");
// Define vars
var dirs = new[]
{
Directory("./build"),
Directory("./glidex.forms/bin") + Directory(configuration),
Directory("./glidex.forms/obj") + Directory(configuration),
Directory("./glidex.forms.sample/bin") + Directory(configuration),
Directory("./glidex.forms.sample/obj") + Directory(configuration),
};
string output = dirs[0];
string sln = "./glidex.sln";
string version = "2.1.1";
string suffix = "";
string buildNumber = Environment.GetEnvironmentVariable ("BUILD_BUILDNUMBER");
if (!string.IsNullOrEmpty(buildNumber))
{
version += "." + buildNumber;
}
Task("Boots")
.Does(async () =>
{
await Boots (Product.XamarinAndroid, ReleaseChannel.Preview);
});
Task("Clean")
.Does(() =>
{
foreach (var dir in dirs)
CleanDirectory(dir);
});
Task("Build")
.Does(() =>
{
MSBuild(sln, MSBuildSettings());
});
Task("Install")
.IsDependentOn("Build")
.Does(() =>
{
MSBuild("./glidex.forms.sample/glidex.forms.sample.csproj", MSBuildSettings().WithTarget("Install").WithTarget("_Run"));
});
Task("NuGet-Package")
.IsDependentOn("Build")
.Does(() =>
{
package(version + suffix, "./glidex.forms/glidex.forms.nuspec", "glidex.forms.dll", output);
});
Task("NuGet-Push")
.Does(() =>
{
push("./build/glidex.forms." + version + suffix + ".nupkg");
});
Task("Default")
.IsDependentOn("NuGet-Package");
Task("CI")
.IsDependentOn("Boots")
.IsDependentOn("NuGet-Package");
RunTarget(target);