This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
build.cake
65 lines (56 loc) · 1.94 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
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/Connectivity.sln";
var NUNIT_RESULT_PARSER = "./nunit-summary.exe";
Task("Libraries").Does(()=>
{
NuGetRestore (SLN);
MSBuild (SLN, c => {
c.Configuration = CONFIG;
c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86;
});
});
Task ("NuGet")
.IsDependentOn ("Libraries")
.Does (() =>
{
if(!DirectoryExists("./Build/nuget/"))
CreateDirectory("./Build/nuget");
NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings {
Version = VERSION,
OutputDirectory = "./Build/nuget/",
BasePath = "./"
});
});
//Build the component, which build samples, nugets, and libraries
Task ("Default").IsDependentOn("NuGet");
Task ("RunDroidTests")
.IsDependentOn("DownloadUnitTestTools")
.Does(()=>
{
var outputPath = MakeAbsolute(Directory("./tests/Connectivity.Tests.Android/bin/Debug"));
MSBuild("./tests/Connectivity.Tests.Android/Connectivity.Tests.Android.csproj",
new MSBuildSettings()
.WithProperty("MyBuildOutputPath", outputPath.ToString())
.WithTarget("SignAndroidPackage")
.WithTarget("RunUnitTests"));
var exe = MakeAbsolute(File(NUNIT_RESULT_PARSER));
StartProcess(exe.ToString(), outputPath.CombineWithFilePath("test-results-Debug.xml").ToString());
});
Task("DownloadUnitTestTools")
.Does(()=>{
var exe = MakeAbsolute(File(NUNIT_RESULT_PARSER));
if(!FileExists(exe.ToString()))
DownloadFile("https://github.com/prashantvc/nunit-summary/releases/download/0.4/nunit-summary.exe","nunit-summary.exe");
else
Information("nunit-summary.exe exists");
});
Task ("Clean").Does (() =>
{
CleanDirectory ("./component/tools/");
CleanDirectories ("./Build/");
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});
RunTarget (TARGET);