Skip to content

Commit ddb04ae

Browse files
authored
Merge pull request #99 from rafaelsc/feature/cleanUpReferences
Clean-up project references
2 parents 65e237f + ae71432 commit ddb04ae

File tree

6 files changed

+26
-47
lines changed

6 files changed

+26
-47
lines changed

Build.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
Write-Host "build: Build started"
1+
Write-Output "build: Build started"
2+
3+
& dotnet --info
4+
& dotnet --list-sdks
25

36
Push-Location $PSScriptRoot
47

58
if(Test-Path .\artifacts) {
6-
Write-Host "build: Cleaning .\artifacts"
9+
Write-Output "build: Cleaning .\artifacts"
710
Remove-Item .\artifacts -Force -Recurse
811
}
912

@@ -15,13 +18,13 @@ $suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch
1518
$commitHash = $(git rev-parse --short HEAD)
1619
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1720

18-
Write-Host "build: Package version suffix is $suffix"
19-
Write-Host "build: Build version suffix is $buildSuffix"
21+
Write-Output "build: Package version suffix is $suffix"
22+
Write-Output "build: Build version suffix is $buildSuffix"
2023

2124
foreach ($src in Get-ChildItem src/*) {
2225
Push-Location $src
2326

24-
Write-Host "build: Packaging project in $src"
27+
Write-Output "build: Packaging project in $src"
2528

2629
& dotnet build -c Release --version-suffix=$buildSuffix
2730
if ($suffix) {
@@ -37,7 +40,7 @@ foreach ($src in Get-ChildItem src/*) {
3740
foreach ($sample in Get-ChildItem sample/*) {
3841
Push-Location $sample
3942

40-
Write-Host "build: Testing project in $sample"
43+
Write-Output "build: Testing project in $sample"
4144

4245
& dotnet build -c Release --version-suffix=$buildSuffix
4346
if($LASTEXITCODE -ne 0) { exit 3 }
@@ -48,7 +51,7 @@ foreach ($sample in Get-ChildItem sample/*) {
4851
foreach ($test in Get-ChildItem test/*.Tests) {
4952
Push-Location $test
5053

51-
Write-Host "build: Testing project in $test"
54+
Write-Output "build: Testing project in $test"
5255

5356
& dotnet test -c Release
5457
if($LASTEXITCODE -ne 0) { exit 3 }

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2017
3+
image:
4+
- Visual Studio 2019
45
configuration: Release
56
test: off
67
build_script:

sample/ConsoleDemo/ConsoleDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net45;netcoreapp2.2</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

src/Serilog.Sinks.Console/Serilog.Sinks.Console.csproj

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>A Serilog sink that writes log events to the console/terminal.</Description>
55
<VersionPrefix>4.0.0</VersionPrefix>
66
<Authors>Serilog Contributors</Authors>
7-
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
7+
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;</TargetFrameworks>
88
<AssemblyName>Serilog.Sinks.Console</AssemblyName>
99
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
1010
<SignAssembly>true</SignAssembly>
@@ -20,39 +20,18 @@
2020
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
2121
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2222
<!-- Don't reference the full NETStandard.Library -->
23-
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' And '$(TargetFramework)' != 'netcoreapp2.0' ">true</DisableImplicitFrameworkReferences>
23+
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' ">true</DisableImplicitFrameworkReferences>
2424
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
2525
<TreatSpecificWarningsAsErrors />
2626
<RootNamespace>Serilog</RootNamespace>
2727
</PropertyGroup>
2828

29-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
30-
<DefineConstants>$(DefineConstants);PINVOKE</DefineConstants>
31-
</PropertyGroup>
32-
33-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
34-
<DefineConstants>$(DefineConstants);PINVOKE;RUNTIME_INFORMATION</DefineConstants>
29+
<PropertyGroup Condition=" '$(TargetFramework)' != 'net45' ">
30+
<DefineConstants>$(DefineConstants);RUNTIME_INFORMATION</DefineConstants>
3531
</PropertyGroup>
3632

3733
<ItemGroup>
3834
<PackageReference Include="Serilog" Version="2.8.0" />
3935
</ItemGroup>
4036

41-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
42-
<Reference Include="System" />
43-
<Reference Include="System.Core" />
44-
<Reference Include="Microsoft.CSharp" />
45-
</ItemGroup>
46-
47-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
48-
<PackageReference Include="System.Console" Version="4.3.0" />
49-
</ItemGroup>
50-
51-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
52-
<PackageReference Include="System.Console" Version="4.3.0" />
53-
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
54-
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
55-
</ItemGroup>
56-
57-
5837
</Project>

src/Serilog.Sinks.Console/Sinks/SystemConsole/Platform/WindowsConsole.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#if PINVOKE
1615
using System;
1716
using System.Runtime.InteropServices;
18-
#endif
1917

2018
namespace Serilog.Sinks.SystemConsole.Platform
2119
{
2220
static class WindowsConsole
2321
{
24-
#if PINVOKE
2522
public static void EnableVirtualTerminalProcessing()
2623
{
2724
#if RUNTIME_INFORMATION
@@ -50,10 +47,6 @@ public static void EnableVirtualTerminalProcessing()
5047

5148
[DllImport("kernel32.dll", SetLastError = true)]
5249
static extern bool SetConsoleMode(IntPtr handle, uint mode);
53-
#else
54-
public static void EnableVirtualTerminalProcessing()
55-
{
56-
}
57-
#endif
50+
5851
}
5952
}

test/Serilog.Sinks.Console.Tests/Serilog.Sinks.Console.Tests.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461;netcoreapp2.2</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
55
<AssemblyName>Serilog.Sinks.SystemConsole.Tests</AssemblyName>
66
<PackageId>Serilog.Sinks.Console.Tests</PackageId>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
@@ -21,10 +21,13 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
25-
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
26-
<PackageReference Include="xunit" Version="2.2.0" />
27-
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
25+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
</PackageReference>
29+
<PackageReference Include="xunit" Version="2.4.1" />
30+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
2831
</ItemGroup>
2932

3033
<ItemGroup>

0 commit comments

Comments
 (0)