forked from jamesmontemagno/GeolocatorPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
65 lines (53 loc) · 1.64 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
#addin nuget:?package=Cake.Android.SdkManager
var TARGET = Argument ("target", Argument ("t", "Default"));
var VERSION = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999");
var CONFIG = Argument("configuration", EnvironmentVariable ("CONFIGURATION") ?? "Release");
var SLN = "./src/Geolocator.sln";
var ANDROID_HOME = EnvironmentVariable ("ANDROID_HOME") ?? Argument ("android_home", "");
Task("Libraries").Does(()=>
{
NuGetRestore (SLN);
MSBuild (SLN, c => {
c.Configuration = CONFIG;
c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86;
});
});
Task ("NuGet")
.IsDependentOn ("AndroidSDK")
.IsDependentOn ("Libraries")
.Does (() =>
{
if(!DirectoryExists("./Build/nuget/"))
CreateDirectory("./Build/nuget");
NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings {
Version = VERSION,
OutputDirectory = "./Build/nuget/",
BasePath = "./"
});
});
Task ("AndroidSDK")
.Does (() =>
{
Information ("ANDROID_HOME: {0}", ANDROID_HOME);
var androidSdkSettings = new AndroidSdkManagerToolSettings {
SdkRoot = ANDROID_HOME,
SkipVersionCheck = true
};
try { AcceptLicenses (androidSdkSettings); } catch { }
AndroidSdkManagerInstall (new [] {
"platforms;android-15",
"platforms;android-23",
"platforms;android-25",
"platforms;android-26"
}, androidSdkSettings);
});
//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);