Skip to content

Commit 5f08597

Browse files
committed
Build.ps1, key file, project.json details.
1 parent 15746cf commit 5f08597

File tree

3 files changed

+113
-6
lines changed

3 files changed

+113
-6
lines changed

Build.ps1

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
function Install-Dnvm
2+
{
3+
& where.exe dnvm 2>&1 | Out-Null
4+
if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true))
5+
{
6+
Write-Host "DNVM not found"
7+
&{$Branch='dev';iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
8+
9+
# Normally this happens automatically during install but AppVeyor has
10+
# an issue where you may need to manually re-run setup from within this process.
11+
if($env:DNX_HOME -eq $NULL)
12+
{
13+
Write-Host "Initial DNVM environment setup failed; running manual setup"
14+
$tempDnvmPath = Join-Path $env:TEMP "dnvminstall"
15+
$dnvmSetupCmdPath = Join-Path $tempDnvmPath "dnvm.ps1"
16+
& $dnvmSetupCmdPath setup
17+
}
18+
}
19+
}
20+
21+
function Get-DnxVersion
22+
{
23+
$globalJson = Join-Path $PSScriptRoot "global.json"
24+
$jsonData = Get-Content -Path $globalJson -Raw | ConvertFrom-JSON
25+
return $jsonData.sdk.version
26+
}
27+
28+
function Restore-Packages
29+
{
30+
param([string] $DirectoryName)
31+
& dnu restore ("""" + $DirectoryName + """")
32+
}
33+
34+
function Build-Projects
35+
{
36+
param([string] $DirectoryName)
37+
& dnu build ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\testbin; if($LASTEXITCODE -ne 0) { exit 1 }
38+
& dnu pack ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\packages; if($LASTEXITCODE -ne 0) { exit 1 }
39+
}
40+
41+
function Build-TestProjects
42+
{
43+
param([string] $DirectoryName)
44+
& dnu build ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\testbin; if($LASTEXITCODE -ne 0) { exit 1 }
45+
}
46+
47+
function Test-Projects
48+
{
49+
param([string] $DirectoryName)
50+
& dnx -p ("""" + $DirectoryName + """") test; if($LASTEXITCODE -ne 0) { exit 2 }
51+
}
52+
53+
function Remove-PathVariable
54+
{
55+
param([string] $VariableToRemove)
56+
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
57+
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
58+
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
59+
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
60+
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
61+
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
62+
}
63+
64+
Push-Location $PSScriptRoot
65+
66+
$dnxVersion = Get-DnxVersion
67+
68+
# Clean
69+
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
70+
71+
# Remove the installed DNVM from the path and force use of
72+
# per-user DNVM (which we can upgrade as needed without admin permissions)
73+
Remove-PathVariable "*Program Files\Microsoft DNX\DNVM*"
74+
75+
# Make sure per-user DNVM is installed
76+
Install-Dnvm
77+
78+
# Install DNX
79+
dnvm install $dnxVersion -r CoreCLR -NoNative
80+
dnvm install $dnxVersion -r CLR -NoNative
81+
dnvm use $dnxVersion -r CLR
82+
83+
# Package restore
84+
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName }
85+
86+
# Set build number
87+
$env:DNX_BUILD_VERSION = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
88+
Write-Host "Build number: " $env:DNX_BUILD_VERSION
89+
90+
# Build/package
91+
Get-ChildItem -Path .\src -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_.DirectoryName }
92+
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Build-TestProjects $_.DirectoryName }
93+
94+
# Test
95+
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
96+
97+
# Switch to Core CLR
98+
dnvm use $dnxVersion -r CoreCLR
99+
100+
# Test again
101+
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName }
102+
103+
Pop-Location

assets/Serilog.snk

596 Bytes
Binary file not shown.

src/Serilog.Settings.Configuration/project.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"version": "1.0.0-*",
3-
"description": "Serilog.Settings.Configuration Class Library",
4-
"authors": [ "nblumhardt" ],
5-
"tags": [ "" ],
6-
"projectUrl": "",
7-
"licenseUrl": "",
2+
"version": "2.0.0-beta-*",
3+
"description": "Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.",
4+
"authors": [ "Serilog Contributors" ],
5+
"tags": [ "serilog", "json" ],
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",
9+
"compilationOptions": {
10+
"keyFile": "../../assets/Serilog.snk"
11+
},
812
"frameworks": {
913
"net451": { },
1014
"dotnet5.4": {

0 commit comments

Comments
 (0)