Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up project references #99

Merged
merged 6 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Write-Host "build: Build started"
Write-Output "build: Build started"

& dotnet --info
& dotnet --list-sdks

Push-Location $PSScriptRoot

if(Test-Path .\artifacts) {
Write-Host "build: Cleaning .\artifacts"
Write-Output "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}

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

Write-Host "build: Package version suffix is $suffix"
Write-Host "build: Build version suffix is $buildSuffix"
Write-Output "build: Package version suffix is $suffix"
Write-Output "build: Build version suffix is $buildSuffix"

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

Write-Host "build: Packaging project in $src"
Write-Output "build: Packaging project in $src"

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

Write-Host "build: Testing project in $sample"
Write-Output "build: Testing project in $sample"

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

Write-Host "build: Testing project in $test"
Write-Output "build: Testing project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2017
image:
- Visual Studio 2019
configuration: Release
test: off
build_script:
Expand Down
2 changes: 1 addition & 1 deletion sample/ConsoleDemo/ConsoleDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net45;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 4 additions & 25 deletions src/Serilog.Sinks.Console/Serilog.Sinks.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>A Serilog sink that writes log events to the console/terminal.</Description>
<VersionPrefix>4.0.0</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;</TargetFrameworks>
<AssemblyName>Serilog.Sinks.Console</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -20,39 +20,18 @@
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Don't reference the full NETStandard.Library -->
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' And '$(TargetFramework)' != 'netcoreapp2.0' ">true</DisableImplicitFrameworkReferences>
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' ">true</DisableImplicitFrameworkReferences>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<RootNamespace>Serilog</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>$(DefineConstants);PINVOKE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<DefineConstants>$(DefineConstants);PINVOKE;RUNTIME_INFORMATION</DefineConstants>
<PropertyGroup Condition=" '$(TargetFramework)' != 'net45' ">
<DefineConstants>$(DefineConstants);RUNTIME_INFORMATION</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.8.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="System.Console" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<PackageReference Include="System.Console" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if PINVOKE
using System;
using System.Runtime.InteropServices;
#endif

namespace Serilog.Sinks.SystemConsole.Platform
{
static class WindowsConsole
{
#if PINVOKE
public static void EnableVirtualTerminalProcessing()
{
#if RUNTIME_INFORMATION
Expand Down Expand Up @@ -50,10 +47,6 @@ public static void EnableVirtualTerminalProcessing()

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool SetConsoleMode(IntPtr handle, uint mode);
#else
public static void EnableVirtualTerminalProcessing()
{
}
#endif

}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
<AssemblyName>Serilog.Sinks.SystemConsole.Tests</AssemblyName>
<PackageId>Serilog.Sinks.Console.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand All @@ -21,10 +21,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down