forked from cake-contrib/Cake.XCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cake
More file actions
52 lines (40 loc) · 1.23 KB
/
build.cake
File metadata and controls
52 lines (40 loc) · 1.23 KB
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
var sln = "./Cake.XCode.sln";
var nuspec = "./Cake.XCode.nuspec";
var target = Argument ("target", "lib");
Task ("lib").Does (() =>
{
NuGetRestore (sln);
DotNetBuild (sln, c => c.Configuration = "Release");
});
Task ("nuget").IsDependentOn ("lib").Does (() =>
{
CreateDirectory ("./nupkg/");
NuGetPack (nuspec, new NuGetPackSettings {
Verbosity = NuGetVerbosity.Detailed,
OutputDirectory = "./nupkg/",
// NuGet messes up path on mac, so let's add ./ in front again
BasePath = "././",
});
});
Task ("push").IsDependentOn ("nuget").Does (() =>
{
// Get the newest (by last write time) to publish
var newestNupkg = GetFiles ("nupkg/*.nupkg")
.OrderBy (f => new System.IO.FileInfo (f.FullPath).LastWriteTimeUtc)
.LastOrDefault ();
var apiKey = TransformTextFile ("./.nugetapikey").ToString ();
NuGetPush (newestNupkg, new NuGetPushSettings {
Verbosity = NuGetVerbosity.Detailed,
ApiKey = apiKey
});
});
Task ("clean").Does (() =>
{
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
CleanDirectories ("./**/Components");
CleanDirectories ("./**/tools");
if (DirectoryExists ("./Cake.XCode.Tests/TestProjects/tmp"))
DeleteDirectory ("./Cake.XCode.Tests/TestProjects/tmp", true);
});
RunTarget (target);