forked from serilog-contrib/serilog-sinks-teams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
87 lines (76 loc) · 2.12 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
#tool "nuget:?package=xunit.runner.console"
#load "parameters.cake"
var parameters = BuildParameters.GetParameters(Context);
Task("Restore-NuGet-Packages")
.Does(() =>
{
MSBuild("src/Serilog.Sinks.MicrosoftTeams.sln",
new MSBuildSettings
{
ToolPath = parameters.MSBuildPath
}
.SetConfiguration(parameters.SolutionBuildConfiguration)
.WithTarget("restore"));
});
Task("Create-Version-Info")
.Does(() =>
{
CreateAssemblyInfo(File("AssemblyVersionInfo.cs"), new AssemblyInfoSettings
{
Version = parameters.AssemblyVersion,
FileVersion = parameters.Version,
InformationalVersion = parameters.FullVersion
});
});
Task("Build")
.IsDependentOn("Create-Version-Info")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
MSBuild("src/Serilog.Sinks.MicrosoftTeams.sln", new MSBuildSettings
{
ToolPath = parameters.MSBuildPath
}
.SetConfiguration(parameters.SolutionBuildConfiguration)
.WithTarget("build")
);
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
DotNetCoreTest("src/Serilog.Sinks.MicrosoftTeams.Tests/Serilog.Sinks.MicrosoftTeams.Tests.csproj");
});
Task("Pack")
.IsDependentOn("Build")
.Does(() =>
{
var outputPath = MakeAbsolute(Directory("build")).FullPath;
MSBuild("src/Serilog.Sinks.MicrosoftTeams/Serilog.Sinks.MicrosoftTeams.csproj", new MSBuildSettings
{
ToolPath = parameters.MSBuildPath
}
.SetConfiguration(parameters.SolutionBuildConfiguration)
.WithProperty("PackageVersion", parameters.Version)
.WithProperty("PackageOutputPath", outputPath)
.WithTarget("pack")
);
});
Task("Restore-Version-Info")
.Does(() =>
{
CreateAssemblyInfo(File("AssemblyVersionInfo.cs"), new AssemblyInfoSettings
{
Version = "0.0.0",
FileVersion = "0.0.0",
InformationalVersion = "0.0.0"
});
});
Task("Default")
.IsDependentOn("Test")
.IsDependentOn("Pack")
.IsDependentOn("Restore-Version-Info")
.Does(() =>
{
});
RunTarget(parameters.Target);