forked from sshnet/SSH.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
71 lines (60 loc) · 1.98 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
#addin nuget:https://ci.appveyor.com/nuget/cake-utility-4ufl9hamniq3/?package=Cake.Utility
#addin nuget:?package=Cake.Git
var configuration = EnvironmentVariable("CONFIGURATION") ?? Argument("configuration", "Release");
var buildHelper = GetVersionHelper();
if (!buildHelper.IsAppVeyor){
buildHelper.Branch = Argument("branch", GitBranchCurrent(".").FriendlyName);
buildHelper.CommitMessageShort = GitLogTip(".").MessageShort; //https://github.com/WCOMAB/Cake_Git
}
var verInfo = buildHelper.GetNextVersion("1.0.0");
buildHelper.SetNextVersion(verInfo);
var solutionInfo = buildHelper.GetSolutionToBuild();
Task("Patch-Assembly-Info")
.WithCriteria(() => buildHelper.IsCiBuildEnvironment)
.Does(() =>
{
//buildHelper.PatchAllAssemblyInfo(verInfo, "");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
var msBuildSettings = new MSBuildSettings {
Verbosity = Verbosity.Minimal, //http://cakebuild.net/api/Cake.Core.Diagnostics/Verbosity/
Configuration = configuration,
//ToolVersion = MSBuildToolVersion.VS2015,
//PlatformTarget = PlatformTarget.MSIL
};
MSBuild(solutionInfo.SolutionFileAndPath, msBuildSettings);
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
var nuspecFiles = GetFiles("./**/*.nuspec");
foreach (var nuspec in nuspecFiles){
Information(nuspec.FullPath);
var csproj = nuspec.ChangeExtension(".csproj");
Information(csproj.FullPath);
var output = Directory("./Artifacts");
CreateDirectory(output);
NuGetPack(csproj.FullPath, new NuGetPackSettings {
Version = verInfo.FullVersion,
OutputDirectory = output.Path.FullPath,
IncludeReferencedProjects = true,
Properties = new Dictionary<string, string> { {"Configuration", configuration} },
});
}
});
Task("Restore-NuGet-Packages")
.IsDependentOn("Patch-Assembly-Info")
.Does(() =>
{
NuGetRestore(solutionInfo.SolutionFileAndPath);
});
Task("Default")
.IsDependentOn("Pack")
.Does(() =>
{
});
RunTarget("Default");