Skip to content

Commit db7d34e

Browse files
committed
.NET Core RC2 Update
1 parent f809f46 commit db7d34e

File tree

4 files changed

+31
-105
lines changed

4 files changed

+31
-105
lines changed

Build.ps1

Lines changed: 6 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,15 @@
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
88-
89-
# Package restore
90-
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName }
91-
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
95-
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 }
5+
& dotnet restore
996

100-
# Test
101-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
7+
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1028

103-
# Switch to Core CLR
104-
dnvm use $dnxVersion -r CoreCLR
9+
Push-Location src/Serilog.Sinks.Trace
10510

106-
# Test again
107-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
11+
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
12+
if($LASTEXITCODE -ne 0) { exit 1 }
10813

10914
Pop-Location
15+
Pop-Location

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# The thread enricher for Serilog.
2-
### Enrich Serilog events with properties from the current thread.
3-
4-
##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).
1+
# Serilog.Enricher.Thread
52

3+
Enrich Serilog events with properties from the current thread.
4+
65
[![Build status](https://ci.appveyor.com/api/projects/status/2vgxdy3swg6eaj3f?svg=true)](https://ci.appveyor.com/project/serilog/serilog-enrichers-thread) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Enrichers.Thread.svg?style=flat)](https://www.nuget.org/packages/Serilog.Enricher.Thread/)
76

87
* [Documentation](https://github.com/serilog/serilog/wiki)

appveyor.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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)$/

src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.xproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
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>

0 commit comments

Comments
 (0)