-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.cake
96 lines (87 loc) · 2.59 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#tool "nuget:?package=NUnit.ConsoleRunner"
#tool "nuget:?package=GitVersion.CommandLine"
var configuration = Argument("configuration", "Debug");
var target = Argument("target", "Default");
string version = null;
Task("Restore")
.Does(() =>
{
NuGetRestore("NCalc.sln");
});
Task("Clean")
.Does(() =>
{
CleanDirectory("./nuget");
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
});
Task("UpdateAssemblyInfo")
.Does(() =>
{
version = GitVersion(new GitVersionSettings { UpdateAssemblyInfo = true }).NuGetVersionV2;
if(AppVeyor.IsRunningOnAppVeyor)
{
AppVeyor.UpdateBuildVersion(version);
}
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.IsDependentOn("UpdateAssemblyInfo")
.Does(() =>
{
MSBuild("NCalc.sln", configurator =>
configurator
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal));
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
NUnit3("./**/bin/**/*.Tests.dll");
if(AppVeyor.IsRunningOnAppVeyor)
{
AppVeyor.UploadTestResults("./TestResult.xml", AppVeyorTestResultsType.NUnit3);
}
});
Task("Pack")
.IsDependentOn("Test")
.Does(() =>
{
var nuGetPackSettings = new NuGetPackSettings
{
Id = "NCalc-Edge",
Version = version,
Authors = new[] {"sebastienros", "pitermarx"},
Description = "NCalc is a mathematical expressions evaluator in .NET. " +
"NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions.",
Dependencies = new [] {
new NuSpecDependency {
Id = "Antlr",
Version = "3.5.0.2"
}
},
ProjectUrl = new Uri("https://github.com/pitermarx/NCalc-Edge"),
LicenseUrl = new Uri("http://ncalc.codeplex.com/license"),
Tags = new [] {"mathematical","expression","parse","evaluate"},
Files = new [] {
new NuSpecContent {
Source = "Evaluant.Calculator/bin/Release/NCalc.dll",
Target = "lib\\net35\\"
},
},
BasePath = "./",
OutputDirectory = "./nuget"
};
NuGetPack(nuGetPackSettings);
if(AppVeyor.IsRunningOnAppVeyor)
{
var file = GetFiles("nuget/NCalc-Edge*.nupkg").First();
AppVeyor.UploadArtifact(file);
AppVeyor.UploadArtifact("Evaluant.Calculator/bin/Release/NCalc.dll");
}
});
Task("Default")
.IsDependentOn("Pack");
RunTarget(target);