Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

Commit d8fd274

Browse files
committed
Address CR feedback
- Set version to v3 as there's already v2 releases. - Update Build.ps1 - Add empty test directory
1 parent f025a72 commit d8fd274

File tree

6 files changed

+97
-8
lines changed

6 files changed

+97
-8
lines changed

Build.ps1

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
1+
echo "build: Build started"
2+
13
Push-Location $PSScriptRoot
24

3-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
5+
if(Test-Path .\artifacts) {
6+
echo "build: Cleaning .\artifacts"
7+
Remove-Item .\artifacts -Force -Recurse
8+
}
9+
10+
& dotnet restore --no-cache
11+
12+
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
13+
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
15+
16+
echo "build: Version suffix is $suffix"
17+
18+
foreach ($src in ls src/*) {
19+
Push-Location $src
20+
21+
echo "build: Packaging project in $src"
22+
23+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
24+
if($LASTEXITCODE -ne 0) { exit 1 }
25+
26+
Pop-Location
27+
}
28+
29+
foreach ($test in ls test/*.PerformanceTests) {
30+
Push-Location $test
31+
32+
echo "build: Building performance test project in $test"
33+
34+
& dotnet build -c Release
35+
if($LASTEXITCODE -ne 0) { exit 2 }
36+
37+
Pop-Location
38+
}
439

5-
& dotnet restore
40+
foreach ($test in ls test/*.Tests) {
41+
Push-Location $test
642

7-
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
43+
echo "build: Testing project in $test"
844

9-
Push-Location src/Serilog.Sinks.NLog
45+
& dotnet test -c Release
46+
if($LASTEXITCODE -ne 0) { exit 3 }
1047

11-
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
12-
if($LASTEXITCODE -ne 0) { exit 1 }
48+
Pop-Location
49+
}
1350

1451
Pop-Location
15-
Pop-Location

serilog-sinks-nlog.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.NLog", "src\Serilog.Sinks.NLog\Serilog.Sinks.NLog.xproj", "{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}"
77
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{88A2B525-3326-4652-9BA4-A26227703B4C}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DC682EBD-33E3-4ECF-922A-C022758E34E6}"
11+
EndProject
12+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.NLog.Tests", "test\Serilog.Sinks.NLog.Tests\Serilog.Sinks.NLog.Tests.xproj", "{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}"
13+
EndProject
814
Global
915
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1016
Debug|Any CPU = Debug|Any CPU
@@ -15,8 +21,16 @@ Global
1521
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
1622
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
1723
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Release|Any CPU.Build.0 = Release|Any CPU
1828
EndGlobalSection
1929
GlobalSection(SolutionProperties) = preSolution
2030
HideSolutionNode = FALSE
2131
EndGlobalSection
32+
GlobalSection(NestedProjects) = preSolution
33+
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4} = {88A2B525-3326-4652-9BA4-A26227703B4C}
34+
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680} = {DC682EBD-33E3-4ECF-922A-C022758E34E6}
35+
EndGlobalSection
2236
EndGlobal

src/Serilog.Sinks.NLog/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-*",
2+
"version": "3.0.0-*",
33
"description": "Serilog event sink that writes to NLog. Merge your new Serilog event stream into your existing NLog infrastructure.",
44
"authors": [ "Serilog Contributors" ],
55
"packOptions": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Empty file just to generate the test assembly
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>2c54feb0-e282-40e8-90f4-0cdb4e7cb680</ProjectGuid>
10+
<RootNamespace>Serilog.Sinks.NLog.Tests</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"testRunner": "xunit",
3+
"dependencies": {
4+
"xunit": "2.2.0-beta2-build3300",
5+
"dotnet-test-xunit": "2.2.0-preview2-build1029",
6+
"Serilog.Sinks.NLog": { "target": "project" }
7+
},
8+
"frameworks": {
9+
"netcoreapp1.0": {
10+
"imports": "portable-net45+win8",
11+
"dependencies": {
12+
"Microsoft.NETCore.App": {
13+
"version": "1.0.0",
14+
"type": "platform"
15+
}
16+
}
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)