Skip to content

Commit 2fe862e

Browse files
committed
Release 2.0
1 parent 6781b65 commit 2fe862e

File tree

8 files changed

+83
-128
lines changed

8 files changed

+83
-128
lines changed

Build.ps1

Lines changed: 16 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,29 @@
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
5+
& dotnet restore --no-cache
836

84-
# Install DNX
85-
dnvm install $dnxVersion -r CoreCLR -NoNative
86-
dnvm install $dnxVersion -r CLR -NoNative
87-
dnvm use $dnxVersion -r CLR
7+
$branch = $(git symbolic-ref --short -q HEAD)
8+
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
9+
$suffix = @{ $true = ""; $false = "$branch-$revision"}[$branch -eq "master" -and $revision -ne "local"]
8810

89-
# Package restore
90-
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName }
11+
foreach ($src in ls src/Serilog.*) {
12+
Push-Location $src
9113

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
14+
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix
15+
if($LASTEXITCODE -ne 0) { exit 1 }
9516

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 }
17+
Pop-Location
18+
}
9919

100-
# Test
101-
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
20+
foreach ($test in ls test/Serilog.*.Tests) {
21+
Push-Location $test
10222

103-
# Switch to Core CLR
104-
# dnvm use $dnxVersion -r CoreCLR
23+
& dotnet test -c Release
24+
if($LASTEXITCODE -ne 0) { exit 2 }
10525

106-
# Test again
107-
# Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
26+
Pop-Location
27+
}
10828

10929
Pop-Location

appveyor.yml

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

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-update1"
5-
}
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003121"
5+
}
66
}

src/Serilog.Settings.AppSettings/Serilog.Settings.AppSettings.xproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ProjectGuid>0d9f37e3-2cb4-4c0d-a307-32bb71defdd4</ProjectGuid>
1010
<RootNamespace>Serilog</RootNamespace>
1111
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>

src/Serilog.Settings.AppSettings/project.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2-
"version": "2.0.0-beta-*",
2+
"version": "2.0.0-*",
33
"description": "XML configuration (System.Configuration <appSettings>) support for Serilog.",
44
"authors": [ "Serilog Contributors" ],
5-
"tags": [ "serilog", "xml" ],
6-
"projectUrl": "http://serilog.net",
7-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
8-
"iconUrl": "http://serilog.net/images/serilog-configuration-nuget.png",
5+
"packOptions": {
6+
"tags": [ "serilog", "xml" ],
7+
"projectUrl": "http://serilog.net",
8+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
9+
"iconUrl": "http://serilog.net/images/serilog-configuration-nuget.png"
10+
},
911
"dependencies": {
10-
"Serilog": "2.0.0-beta-537"
12+
"Serilog": "2.0.0"
1113
},
12-
"compilationOptions": {
14+
"buildOptions": {
1315
"keyFile": "../../assets/Serilog.snk"
1416
},
1517
"frameworks": {
16-
"net45": {
18+
"net4.5": {
1719
"frameworkAssemblies": {
1820
"System.Configuration": ""
1921
}

test/Serilog.Settings.AppSettings.Tests/Serilog.Settings.AppSettings.Tests.xproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ProjectGuid>3c2d8e01-5580-426a-bdd9-ec59cd98e618</ProjectGuid>
1010
<RootNamespace>Serilog.Tests</RootNamespace>
1111
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>

test/Serilog.Settings.AppSettings.Tests/Settings/AppSettingsTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ namespace Serilog.Tests.AppSettings.Tests
99
{
1010
public class AppSettingsTests
1111
{
12+
static AppSettingsTests()
13+
{
14+
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE",
15+
System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"..\..\..\..\app.config"));
16+
}
17+
1218
[Fact]
1319
public void EnvironmentVariableExpansionIsApplied()
1420
{

test/Serilog.Settings.AppSettings.Tests/project.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
2-
"version": "2.0.0-beta-*",
3-
"commands": {
4-
"test": "xunit.runner.dnx",
5-
"test-dnxcore50": "xunit.runner.dnx"
6-
},
7-
"compilationOptions": {
8-
"keyFile": "../../assets/Serilog.snk"
9-
},
2+
"testRunner": "xunit",
103
"dependencies": {
11-
"Serilog.Settings.AppSettings": { "target": "project" }
4+
"Serilog.Settings.AppSettings": { "target": "project" },
5+
"xunit": "2.1.0",
6+
"dotnet-test-xunit": "1.0.0-rc2-build10025"
7+
},
8+
"buildOptions": {
9+
"keyFile": "../../assets/Serilog.snk",
10+
"preserveCompilationContext": true
1211
},
1312
"frameworks": {
14-
"dnx452": {
13+
"net4.5.2": {
1514
"frameworkAssemblies": {
1615
"System.Configuration": ""
1716
},
@@ -20,14 +19,13 @@
2019
"Rx-Main": "2.2.5",
2120
"xunit": "2.1.0",
2221
"xunit.runner.visualstudio": "2.1.0",
23-
"xunit.runner.dnx": "2.1.0-rc1-build204",
24-
"Serilog.Sinks.TextWriter": "2.0.0-beta-519",
25-
"Serilog.Sinks.RollingFile": "2.0.0-beta-519",
26-
"Serilog.Sinks.PeriodicBatching": "2.0.0-beta-519",
27-
"Serilog.Sinks.Observable": "2.0.0-beta-519",
28-
"Serilog.Enrichers.Environment": "2.0.0-beta-519",
29-
"Serilog.Enrichers.Process": "2.0.0-beta-519",
30-
"Serilog.Enrichers.Thread": "2.0.0-beta-519",
22+
"Serilog.Sinks.TextWriter": "2.0.0",
23+
"Serilog.Sinks.RollingFile": "2.0.0",
24+
"Serilog.Sinks.PeriodicBatching": "2.0.0",
25+
"Serilog.Sinks.Observable": "2.0.0-*",
26+
"Serilog.Enrichers.Environment": "2.0.0-*",
27+
"Serilog.Enrichers.Process": "2.0.0-*",
28+
"Serilog.Enrichers.Thread": "2.0.0"
3129
}
3230
}
3331
}

0 commit comments

Comments
 (0)