-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.cake
63 lines (51 loc) · 1.47 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
var target = Argument ("target", "Default");
var AAR_VERSION = "3.0.0";
var NUGET_VERSION = AAR_VERSION;
var AAR_URL = $"https://dl.google.com/android/maven2/com/google/android/flexbox/flexbox/{AAR_VERSION}/flexbox-{AAR_VERSION}.aar";
Task ("Externals")
.WithCriteria (!FileExists ("./externals/flexbox.aar"))
.Does (() =>
{
EnsureDirectoryExists ("./externals");
DownloadFile (AAR_URL, "./externals/flexbox.aar");
XmlPoke("./FlexboxLayout/FlexboxLayout.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
});
Task("Libs")
.IsDependentOn("Externals")
.Does(() =>
{
MSBuild("./FlexboxLayout.sln", c => {
c.Configuration = "Release";
c.Restore = true;
c.MaxCpuCount = 0;
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task("Nuget")
.IsDependentOn("Libs")
.Does(() =>
{
MSBuild ("./FlexboxLayout.sln", c => {
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add("Pack");
c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
c.Properties.Add("DesignTimeBuild", new [] { "false" });
});
});
Task ("Clean")
.Does (() =>
{
if (DirectoryExists ("./externals/"))
DeleteDirectory ("./externals", new DeleteDirectorySettings {
Recursive = true,
Force = true
});
});
Task ("Default")
.IsDependentOn("Clean")
.IsDependentOn("Nuget")
.Does(() => {});
RunTarget (target);