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

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
- Set version to v3 as there's already v2 releases.
- Update Build.ps1
- Add empty test directory
  • Loading branch information
jeremymeng committed Aug 22, 2016
1 parent f025a72 commit d8fd274
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 8 deletions.
50 changes: 43 additions & 7 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
echo "build: Build started"

Push-Location $PSScriptRoot

if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
if(Test-Path .\artifacts) {
echo "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}

& dotnet restore --no-cache

$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]

echo "build: Version suffix is $suffix"

foreach ($src in ls src/*) {
Push-Location $src

echo "build: Packaging project in $src"

& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
if($LASTEXITCODE -ne 0) { exit 1 }

Pop-Location
}

foreach ($test in ls test/*.PerformanceTests) {
Push-Location $test

echo "build: Building performance test project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}

& dotnet restore
foreach ($test in ls test/*.Tests) {
Push-Location $test

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

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

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

Pop-Location
Pop-Location
14 changes: 14 additions & 0 deletions serilog-sinks-nlog.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.NLog", "src\Serilog.Sinks.NLog\Serilog.Sinks.NLog.xproj", "{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{88A2B525-3326-4652-9BA4-A26227703B4C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DC682EBD-33E3-4ECF-922A-C022758E34E6}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,8 +21,16 @@ Global
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4}.Release|Any CPU.Build.0 = Release|Any CPU
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BE40FF8E-7EEA-4094-90F0-CD67B061DCE4} = {88A2B525-3326-4652-9BA4-A26227703B4C}
{2C54FEB0-E282-40E8-90F4-0CDB4E7CB680} = {DC682EBD-33E3-4ECF-922A-C022758E34E6}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.NLog/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0-*",
"version": "3.0.0-*",
"description": "Serilog event sink that writes to NLog. Merge your new Serilog event stream into your existing NLog infrastructure.",
"authors": [ "Serilog Contributors" ],
"packOptions": {
Expand Down
1 change: 1 addition & 0 deletions test/Serilog.Sinks.NLog.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Empty file just to generate the test assembly
19 changes: 19 additions & 0 deletions test/Serilog.Sinks.NLog.Tests/Serilog.Sinks.NLog.Tests.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>2c54feb0-e282-40e8-90f4-0cdb4e7cb680</ProjectGuid>
<RootNamespace>Serilog.Sinks.NLog.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
19 changes: 19 additions & 0 deletions test/Serilog.Sinks.NLog.Tests/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"Serilog.Sinks.NLog": { "target": "project" }
},
"frameworks": {
"netcoreapp1.0": {
"imports": "portable-net45+win8",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
}
}

0 comments on commit d8fd274

Please sign in to comment.