Skip to content

Commit 867429f

Browse files
committed
Upgrade solution for 2.0
1 parent 6939f35 commit 867429f

13 files changed

+268
-343
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33

4+
.vs/
5+
project.lock.json
6+
47
# User-specific files
58
*.suo
69
*.user
@@ -181,3 +184,4 @@ UpgradeLog*.htm
181184

182185
# Microsoft Fakes
183186
FakesAssemblies/
187+

Build.ps1

Lines changed: 17 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,29 @@
1-
param(
2-
[String] $majorMinor = "0.0", # 2.0
3-
[String] $patch = "0", # $env:APPVEYOR_BUILD_VERSION
4-
[String] $customLogger = "", # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll
5-
[Switch] $notouch,
6-
[String] $sln # e.g serilog-sink-name
7-
)
1+
Push-Location $PSScriptRoot
82

9-
function Set-AssemblyVersions($informational, $assembly)
10-
{
11-
(Get-Content assets/CommonAssemblyInfo.cs) |
12-
ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } |
13-
ForEach-Object { $_ -replace """1.0.0""", """$informational""" } |
14-
ForEach-Object { $_ -replace """1.1.1.1""", """$($informational).0""" } |
15-
Set-Content assets/CommonAssemblyInfo.cs
16-
}
17-
18-
function Install-NuGetPackages($solution)
19-
{
20-
nuget restore $solution
21-
}
22-
23-
function Invoke-MSBuild($solution, $customLogger)
24-
{
25-
if ($customLogger)
26-
{
27-
msbuild "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger"
28-
}
29-
else
30-
{
31-
msbuild "$solution" /verbosity:minimal /p:Configuration=Release
32-
}
33-
}
34-
35-
function Invoke-NuGetPackProj($csproj)
36-
{
37-
nuget pack -Prop Configuration=Release -Symbols $csproj
38-
}
39-
40-
function Invoke-NuGetPackSpec($nuspec, $version)
41-
{
42-
nuget pack $nuspec -Version $version -OutputDirectory ..\..\
43-
}
44-
45-
function Invoke-NuGetPack($version)
46-
{
47-
ls src/**/*.csproj |
48-
Where-Object { -not ($_.Name -like "*net40*") } |
49-
ForEach-Object { Invoke-NuGetPackProj $_ }
50-
}
51-
52-
function Invoke-Build($majorMinor, $patch, $customLogger, $notouch, $sln)
53-
{
54-
$package="$majorMinor.$patch"
55-
$slnfile = "$sln.sln"
3+
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
564

57-
Write-Output "$sln $package"
5+
& dotnet restore --no-cache
586

59-
if (-not $notouch)
60-
{
61-
$assembly = "$majorMinor.0.0"
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"]
6210

63-
Write-Output "Assembly version will be set to $assembly"
64-
Set-AssemblyVersions $package $assembly
65-
}
11+
foreach ($src in ls src/Serilog.*) {
12+
Push-Location $src
6613

67-
Install-NuGetPackages $slnfile
68-
69-
Invoke-MSBuild $slnfile $customLogger
14+
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix
15+
if($LASTEXITCODE -ne 0) { exit 1 }
7016

71-
Invoke-NuGetPack $package
17+
Pop-Location
7218
}
7319

74-
$ErrorActionPreference = "Stop"
20+
foreach ($test in ls test/Serilog.*.Tests) {
21+
Push-Location $test
7522

76-
if (-not $sln)
77-
{
78-
$slnfull = ls *.sln |
79-
Where-Object { -not ($_.Name -like "*net40*") } |
80-
Select -first 1
23+
& dotnet test -c Release
24+
if($LASTEXITCODE -ne 0) { exit 2 }
8125

82-
$sln = $slnfull.BaseName
26+
Pop-Location
8327
}
8428

85-
Invoke-Build $majorMinor $patch $customLogger $notouch $sln
29+
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

assets/CommonAssemblyInfo.cs

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

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003121"
5+
}
6+
}

serilog-sinks-azuretablestorage.sln

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.AzureTableStorage", "src\Serilog.Sinks.AzureTableStorage\Serilog.Sinks.AzureTableStorage.csproj", "{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}"
6+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.AzureTableStorage", "src\Serilog.Sinks.AzureTableStorage\Serilog.Sinks.AzureTableStorage.xproj", "{EDB6E773-0A33-4A88-81BC-3B24ABFEBA61}"
7+
EndProject
8+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.AzureTableStorageWithProperties.Tests", "test\Serilog.Sinks.AzureTableStorageWithProperties.Tests\Serilog.Sinks.AzureTableStorageWithProperties.Tests.xproj", "{2740763E-959A-4AAD-BFC9-5B428393DFDE}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
1113
Release|Any CPU = Release|Any CPU
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Release|Any CPU.Build.0 = Release|Any CPU
16+
{EDB6E773-0A33-4A88-81BC-3B24ABFEBA61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{EDB6E773-0A33-4A88-81BC-3B24ABFEBA61}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{EDB6E773-0A33-4A88-81BC-3B24ABFEBA61}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{EDB6E773-0A33-4A88-81BC-3B24ABFEBA61}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{2740763E-959A-4AAD-BFC9-5B428393DFDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{2740763E-959A-4AAD-BFC9-5B428393DFDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{2740763E-959A-4AAD-BFC9-5B428393DFDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{2740763E-959A-4AAD-BFC9-5B428393DFDE}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>edb6e773-0a33-4a88-81bc-3b24abfeba61</ProjectGuid>
10+
<RootNamespace>Serilog.Sinks.AzureTableStorage</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "2.0.0",
3+
"description": "Serilog event sink that writes to Azure Table Storage over HTTP.",
4+
5+
"authors": [ "Robert Moore" ],
6+
"packOptions": {
7+
"tags": [ "serilog", "logging", "azure" ],
8+
"projectUrl": "http://serilog.net",
9+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
10+
"iconUrl": "http://serilog.net/images/serilog-configuration-nuget.png"
11+
},
12+
"dependencies": {
13+
"Serilog": "2.0.0",
14+
"Serilog.Sinks.PeriodicBatching": "2.0.0",
15+
"WindowsAzure.Storage": "4.3.0"
16+
},
17+
"buildOptions": {
18+
"keyFile": "../../assets/Serilog.snk"
19+
},
20+
"frameworks": {
21+
"net4.5": {
22+
"frameworkAssemblies": {
23+
"System.Configuration": ""
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)