Skip to content

Commit 5810168

Browse files
authored
Merge pull request #21 from generik0/dev
Make AppSettings work with netstasndard2.0
2 parents 918decf + ec80008 commit 5810168

File tree

12 files changed

+107
-142
lines changed

12 files changed

+107
-142
lines changed

Build.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@ if(Test-Path .\artifacts) {
1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1414
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

1821
foreach ($src in ls src/*) {
1922
Push-Location $src
2023

2124
echo "build: Packaging project in $src"
2225

23-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
26+
& dotnet build -c Release --version-suffix=$buildSuffix
27+
28+
if($suffix) {
29+
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts --version-suffix=$suffix
30+
} else {
31+
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts
32+
}
2433
if($LASTEXITCODE -ne 0) { exit 1 }
2534

2635
Pop-Location

appveyor.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2015
3+
environment:
4+
os: Visual Studio 2017
45
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"
116
build_script:
127
- ps: ./Build.ps1
138
test: off

global.json

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

serilog-settings-appsettings.sln

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2036
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
1010
Build.ps1 = Build.ps1
11-
global.json = global.json
1211
README.md = README.md
1312
assets\Serilog.snk = assets\Serilog.snk
1413
EndProjectSection
1514
EndProject
1615
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7B927378-9F16-4F6F-B3F6-156395136646}"
1716
EndProject
18-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Settings.AppSettings", "src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.xproj", "{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}"
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Settings.AppSettings", "src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.csproj", "{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}"
1918
EndProject
20-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Settings.AppSettings.Tests", "test\Serilog.Settings.AppSettings.Tests\Serilog.Settings.AppSettings.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Settings.AppSettings.Tests", "test\Serilog.Settings.AppSettings.Tests\Serilog.Settings.AppSettings.Tests.csproj", "{1A0E25F6-B619-440D-BF49-CCBD98666A7C}"
2120
EndProject
2221
Global
2322
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,16 +28,19 @@ Global
2928
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
3029
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
3130
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Release|Any CPU.Build.0 = Release|Any CPU
3635
EndGlobalSection
3736
GlobalSection(SolutionProperties) = preSolution
3837
HideSolutionNode = FALSE
3938
EndGlobalSection
4039
GlobalSection(NestedProjects) = preSolution
4140
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4} = {037440DE-440B-4129-9F7A-09B42D00397E}
42-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {7B927378-9F16-4F6F-B3F6-156395136646}
41+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C} = {7B927378-9F16-4F6F-B3F6-156395136646}
42+
EndGlobalSection
43+
GlobalSection(ExtensibilityGlobals) = postSolution
44+
SolutionGuid = {5FEAB963-FB05-4C61-9B3F-DCF1BE9BB28C}
4345
EndGlobalSection
4446
EndGlobal
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<Description>XML configuration (System.Configuration &lt;appSettings&gt;) support for Serilog.</Description>
5+
<VersionPrefix>2.2.0</VersionPrefix>
6+
<Authors>Serilog Contributors</Authors>
7+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
8+
<AssemblyName>Serilog.Settings.AppSettings</AssemblyName>
9+
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
10+
<SignAssembly>true</SignAssembly>
11+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
12+
<PackageId>Serilog.Settings.AppSettings</PackageId>
13+
<PackageTags>serilog;xml</PackageTags>
14+
<PackageIconUrl>https://serilog.net/images/serilog-configuration-nuget.png</PackageIconUrl>
15+
<PackageProjectUrl>https://github.com/serilog/serilog-settings-appsettings</PackageProjectUrl>
16+
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
17+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
18+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
19+
</PropertyGroup>
20+
21+
<ItemGroup>
22+
<PackageReference Include="Serilog" Version="2.6.0" />
23+
</ItemGroup>
24+
25+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
26+
<Reference Include="System.Configuration" />
27+
<Reference Include="System" />
28+
<Reference Include="Microsoft.CSharp" />
29+
<Reference Include="System.Configuration" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
33+
<PackageReference Include="System.Configuration.ConfigurationManager">
34+
<Version>4.4.1</Version>
35+
</PackageReference>
36+
</ItemGroup>
37+
38+
39+
</Project>

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

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

src/Serilog.Settings.AppSettings/project.json

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

test/Serilog.Settings.AppSettings.Tests/Properties/launchSettings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net45;netcoreapp2.0</TargetFrameworks>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
14+
<PackageReference Include="xunit" Version="2.3.1" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
16+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
17+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
18+
<PackageReference Include="Serilog.Sinks.TextWriter" Version="2.0.0" />
19+
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.1.0" />
20+
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.0.0" />
21+
<PackageReference Include="Serilog.Sinks.Observable" Version="2.0.0-*" />
22+
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.0.0-*" />
23+
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.0-*" />
24+
<PackageReference Include="Serilog.Enrichers.Thread" Version="2.0.0" />
25+
</ItemGroup>
26+
27+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
28+
<Reference Include="System.Configuration" />
29+
<Reference Include="System" />
30+
<Reference Include="Microsoft.CSharp" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<ProjectReference Include="..\..\src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.csproj" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<None Update="tests.config">
39+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40+
</None>
41+
</ItemGroup>
42+
</Project>

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

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

0 commit comments

Comments
 (0)