-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.cake
42 lines (36 loc) · 1.08 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
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 PROJECT_NAME = "XamCal";
var SLN = $"{PROJECT_NAME}.sln";
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/{PROJECT_NAME}.nuspec", new NuGetPackSettings {
Version = VERSION,
OutputDirectory = "./Build/nuget/",
BasePath = "./src"
});
});
//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);