Skip to content

Commit ebc268b

Browse files
committed
Merge pull request #1 from nblumhardt/master
.NET Core RC2 Update
2 parents b388c28 + a62c37c commit ebc268b

22 files changed

+88
-180
lines changed

Build.ps1

Lines changed: 10 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,21 @@
1-
$root = $(Get-Item $($MyInvocation.MyCommand.Path)).DirectoryName
2-
3-
function Install-Dnvm
4-
{
5-
& where.exe dnvm 2>&1 | Out-Null
6-
if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true))
7-
{
8-
Write-Host "DNVM not found"
9-
&{$Branch='dev';iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
10-
11-
# Normally this happens automatically during install but AppVeyor has
12-
# an issue where you may need to manually re-run setup from within this process.
13-
if($env:DNX_HOME -eq $NULL)
14-
{
15-
Write-Host "Initial DNVM environment setup failed; running manual setup"
16-
$tempDnvmPath = Join-Path $env:TEMP "dnvminstall"
17-
$dnvmSetupCmdPath = Join-Path $tempDnvmPath "dnvm.ps1"
18-
& $dnvmSetupCmdPath setup
19-
}
20-
}
21-
}
22-
23-
function Get-DnxVersion
24-
{
25-
$globalJson = Join-Path $PSScriptRoot "global.json"
26-
$jsonData = Get-Content -Path $globalJson -Raw | ConvertFrom-JSON
27-
return $jsonData.sdk.version
28-
}
29-
30-
function Restore-Packages
31-
{
32-
param([string] $DirectoryName)
33-
& dnu restore ("""" + $DirectoryName + """")
34-
}
35-
36-
function Build-Projects
37-
{
38-
param($Directory, $pack)
39-
40-
$DirectoryName = $Directory.DirectoryName
41-
$artifactsFolder = join-path $root "artifacts"
42-
$projectsFolder = join-path $artifactsFolder $Directory.Name
43-
$buildFolder = join-path $projectsFolder "testbin"
44-
$packageFolder = join-path $projectsFolder "packages"
45-
46-
& dnu build ("""" + $DirectoryName + """") --configuration Release --out $buildFolder; if($LASTEXITCODE -ne 0) { exit 1 }
47-
48-
if($pack){
49-
& dnu pack ("""" + $DirectoryName + """") --configuration Release --out $packageFolder; if($LASTEXITCODE -ne 0) { exit 1 }
50-
}
51-
}
52-
53-
function Test-Projects
54-
{
55-
param([string] $DirectoryName)
56-
& dnx -p ("""" + $DirectoryName + """") test; if($LASTEXITCODE -ne 0) { exit 2 }
57-
}
58-
59-
function Remove-PathVariable
60-
{
61-
param([string] $VariableToRemove)
62-
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
63-
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
64-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
65-
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
66-
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
67-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
68-
}
69-
701
Push-Location $PSScriptRoot
712

72-
$dnxVersion = Get-DnxVersion
73-
74-
# Clean
753
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
764

77-
# Remove the installed DNVM from the path and force use of
78-
# per-user DNVM (which we can upgrade as needed without admin permissions)
79-
Remove-PathVariable "*Program Files\Microsoft DNX\DNVM*"
80-
81-
# Make sure per-user DNVM is installed
82-
Install-Dnvm
83-
84-
# Install DNX
85-
dnvm install $dnxVersion -r CoreCLR -NoNative
86-
dnvm install $dnxVersion -r CLR -NoNative
87-
dnvm use $dnxVersion -r CLR
5+
& dotnet restore
886

89-
# Package restore
90-
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName }
7+
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
918

92-
# Set build number
93-
$env:DNX_BUILD_VERSION = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
94-
Write-Host "Build number: " $env:DNX_BUILD_VERSION
9+
Push-Location src/Serilog.Sinks.File
9510

96-
# Build/package
97-
Get-ChildItem -Path .\src -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_ $true }
98-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_ $false }
11+
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
12+
if($LASTEXITCODE -ne 0) { exit 1 }
9913

100-
# Test
101-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
102-
103-
# Switch to Core CLR
104-
dnvm use $dnxVersion -r CoreCLR
14+
Pop-Location
15+
Push-Location test/Serilog.Sinks.File.Tests
10516

106-
# Test again
107-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
17+
& dotnet test -c Release
18+
if($LASTEXITCODE -ne 0) { exit 2 }
10819

10920
Pop-Location
21+
Pop-Location

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#The file sink for Serilog
1+
# Serilog.Sinks.File
22

3-
##NOTE: Work in progress as apart of the [Serilog 2.0 release](https://github.com/serilog/serilog/issues?q=is%3Aissue+is%3Aopen+label%3Av2).
3+
The file sink for Serilog.
44

55
[![Build status](https://ci.appveyor.com/api/projects/status/hh9gymy0n6tne46j?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-file) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.File.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.File/)
66

appveyor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '{build}'
2+
image: Visual Studio 2015
3+
configuration: Release
4+
install:
5+
- ps: mkdir -Force ".\build\" | Out-Null
6+
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1" -OutFile ".\build\installcli.ps1"
7+
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
8+
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath'
9+
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
10+
build_script:
11+
- ps: ./Build.ps1
12+
test: off
13+
artifacts:
14+
- path: artifacts/Serilog.*.nupkg
15+
deploy:
16+
- provider: NuGet
17+
api_key:
18+
secure: nvZ/z+pMS91b3kG4DgfES5AcmwwGoBYQxr9kp4XiJHj25SAlgdIxFx++1N0lFH2x
19+
skip_symbols: true
20+
on:
21+
branch: /^(dev|master)$/
22+

global.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"projects": [ "src", "test" ],
3-
"sdk": {
4-
"version": "1.0.0-rc1-final"
5-
}
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview1-002702"
5+
}
66
}

Serilog.Sinks.File.sln renamed to serilog-sinks-file.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
4+
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
99
ProjectSection(SolutionItems) = preProject
10+
appveyor.yml = appveyor.yml
1011
Build.ps1 = Build.ps1
1112
global.json = global.json
1213
NuGet.Config = NuGet.Config
@@ -18,7 +19,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.File", "src\S
1819
EndProject
1920
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7B927378-9F16-4F6F-B3F6-156395136646}"
2021
EndProject
21-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
22+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.File.Tests", "test\Serilog.Sinks.File.Tests\Serilog.Sinks.File.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
2223
EndProject
2324
Global
2425
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Serilog.Sinks.File/FileLoggerConfigurationExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace Serilog
2424
{
25+
/// <summary>Extends <see cref="LoggerConfiguration"> with methods to add file sinks.</summary>
2526
public static class FileLoggerConfigurationExtensions
2627
{
2728
const long DefaultFileSizeLimitBytes = 1L * 1024 * 1024 * 1024;

src/Serilog.Sinks.File/Serilog.Sinks.File.xproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
<PropertyGroup Label="Globals">
99
<ProjectGuid>57e0ed0e-0f45-48ab-a73d-6a92b7c32095</ProjectGuid>
1010
<RootNamespace>Serilog</RootNamespace>
11-
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>
1616
</PropertyGroup>
17-
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
17+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
1818
</Project>

src/Serilog.Sinks.File/project.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
{
2-
"version": "2.0.0-beta-*",
2+
"version": "2.0.0-rc-*",
33
"description": "The file sink for Serilog",
44
"authors": [ "Serilog Contributors" ],
5-
"tags": [ "serilog", "file", "io" ],
6-
"projectUrl": "http://serilog.net",
7-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
8-
"iconUrl": "http://serilog.net/images/serilog-sink-nuget.png",
5+
"packOptions": {
6+
"tags": [ "serilog", "file", "io" ],
7+
"projectUrl": "http://serilog.net",
8+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
9+
"iconUrl": "http://serilog.net/images/serilog-sink-nuget.png"
10+
},
911
"dependencies": {
10-
"Serilog": "2.0.0-beta-505"
12+
"Serilog": "2.0.0-rc-556"
1113
},
12-
"compilationOptions": {
13-
"keyFile": "../../assets/Serilog.snk"
14+
"buildOptions": {
15+
"keyFile": "../../assets/Serilog.snk",
16+
"xmlDoc": true
1417
},
1518
"frameworks": {
16-
"net45": {
17-
},
18-
"dotnet5.1": {
19+
"net4.5": {},
20+
"netstandard1.3": {
1921
"dependencies": {
20-
"System.IO": "4.0.11-beta-23516",
21-
"System.IO.FileSystem": "4.0.0",
22-
"System.IO.FileSystem.Primitives": "4.0.0"
22+
"System.IO": "4.1.0-rc2-24027",
23+
"System.IO.FileSystem": "4.0.1-rc2-24027",
24+
"System.IO.FileSystem.Primitives": "4.0.1-rc2-24027"
2325
}
2426
}
2527
}

test/Serilog.Tests/Serilog.Tests.xproj renamed to test/Serilog.Sinks.File.Tests/Serilog.Sinks.File.Tests.xproj

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,11 @@
88
<PropertyGroup Label="Globals">
99
<ProjectGuid>3c2d8e01-5580-426a-bdd9-ec59cd98e618</ProjectGuid>
1010
<RootNamespace>Serilog.Tests</RootNamespace>
11-
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>
16-
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
1716
</PropertyGroup>
18-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
19-
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
20-
</PropertyGroup>
21-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
22-
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
23-
</PropertyGroup>
24-
<ItemGroup>
25-
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
26-
</ItemGroup>
27-
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
17+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
2818
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "2.0.0-rc-*",
3+
"testRunner": "xunit",
4+
"dependencies": {
5+
"Serilog.Sinks.File": { "target": "project" },
6+
"xunit": "2.1.0",
7+
"dotnet-test-xunit": "1.0.0-rc2-build10015"
8+
},
9+
"frameworks": {
10+
"net4.5.2": {},
11+
"netcoreapp1.0": {
12+
"dependencies": {
13+
"Microsoft.NETCore.App": {
14+
"type": "platform",
15+
"version": "1.0.0-rc2-3002702"
16+
}
17+
},
18+
"imports": [
19+
"dnxcore50",
20+
"portable-net45+win8"
21+
]
22+
}
23+
}
24+
}

test/Serilog.Tests/project.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)