-
Notifications
You must be signed in to change notification settings - Fork 50
/
build.cake
executable file
·77 lines (63 loc) · 2.4 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
77
// Used by binderator, "Windows" is fine because we only use managed code from it
#tool nuget:?package=Microsoft.Android.Sdk.Windows&version=35.0.0-rc.1.80
// Cake Addins
#addin nuget:?package=Cake.FileHelpers&version=7.0.0
#addin nuget:?package=Newtonsoft.Json&version=13.0.3
#addin nuget:?package=SharpZipLib&version=1.4.2
// Imported scripts
#load "build/cake/setup-environment.cake"
#load "build/cake/update-config.cake"
#load "build/cake/tests.cake"
#load "build/cake/gps-parameters.cake"
#load "build/cake/dotnet-next.cake"
#load "build/cake/binderate.cake"
#load "build/cake/build-and-package.cake"
#load "build/cake/validations.cake"
#load "build/cake/executive-order.cake"
#load "build/cake/clean.cake"
#load "build/cake/performance-timings.cake"
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// The main configuration points
var TARGET = Argument ("t", Argument ("target", "Default"));
var CONFIGURATION = Argument ("c", Argument ("configuration", "Release"));
var VERBOSITY = Argument ("v", Argument ("verbosity", Verbosity.Normal));
// Load all the git variables
var BUILD_COMMIT = EnvironmentVariable("BUILD_COMMIT") ?? "DEV";
var BUILD_NUMBER = EnvironmentVariable("BUILD_NUMBER") ?? "DEBUG";
var BUILD_TIMESTAMP = DateTime.UtcNow.ToString();
var JAVA_HOME = EnvironmentVariable ("JAVA_HOME") ?? Argument ("java_home", "");
// Log some variables
Information ("");
Information ($"JAVA_HOME : {JAVA_HOME}");
Information ($"BUILD_COMMIT : {BUILD_COMMIT}");
Information ($"BUILD_NUMBER : {BUILD_NUMBER}");
Information ($"BUILD_TIMESTAMP : {BUILD_TIMESTAMP}");
Task ("packages")
.IsDependentOn ("binderate")
.IsDependentOn ("nuget");
Task ("full-run")
.IsDependentOn ("binderate")
.IsDependentOn ("nuget")
.IsDependentOn ("samples-dotnet")
.IsDependentOn ("tools-executive-order");
Task ("ci")
.IsDependentOn ("ci-build")
.IsDependentOn ("ci-samples");
// Builds packages but does not run samples
Task ("ci-build")
.IsDependentOn ("inject-variables")
.IsDependentOn ("binderate")
.IsDependentOn ("nuget")
.IsDependentOn ("tools-executive-order");
// for local builds, conditionally do the first binderate
if (FileExists ("./generated/AndroidX.sln")) {
Task ("Default")
.IsDependentOn ("nuget");
} else {
Task ("Default")
.IsDependentOn ("binderate")
.IsDependentOn ("nuget");
}
RunTarget (TARGET);