Skip to content

Added support for .Net Standard 2.0 #51

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

Closed
wants to merge 17 commits into from
Closed
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
41 changes: 41 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

workspace:
clean: all

pool:
vmImage: 'windows-latest'

steps:
- task: UseDotNet@2
displayName: "Use .net core sdk 2.2"
inputs:
packageType: 'sdk'
version: '2.2.x'
- task: DotNetCoreCLI@2
displayName: "Build solution"
inputs:
command: 'build'
arguments: '-c Release'
projects: '.\netstandard\log4net.netstandard.sln'
feedsToUse: 'select'
vstsFeed: 'cc499f7c-f140-4e59-aa34-508c25f2cac1'
- task: CopyFiles@2
displayName: 'Copy package'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\netstandard\log4net\bin\Release'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: 'Publish package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
7 changes: 7 additions & 0 deletions log4net.build
Original file line number Diff line number Diff line change
Expand Up @@ -1913,14 +1913,21 @@ limitations under the License.
<arg if="${current.build.config.release}" value="Release"/>
</exec>
<mkdir dir="${log4net.basedir}/bin/netstandard/1.3"/>
<mkdir dir="${log4net.basedir}/bin/netstandard/2.0"/>
<if test="${current.build.config.release}">
<move todir="${log4net.basedir}/bin/netstandard/1.3/Release">
<fileset basedir="netstandard/log4net/bin/Release/netstandard1.3"/>
</move>
<move todir="${log4net.basedir}/bin/netstandard/2.0/Release">
<fileset basedir="netstandard/log4net/bin/Release/netstandard2.0"/>
</move>
</if>
<ifnot test="${current.build.config.release}">
<move todir="${log4net.basedir}/bin/netstandard/1.3/Debug">
<fileset basedir="netstandard/log4net/bin/Debug/netstandard1.3"/>
</move>
<move todir="${log4net.basedir}/bin/netstandard/2.0/Debug">
<fileset basedir="netstandard/log4net/bin/Debug/netstandard2.0"/>
</move>
</ifnot>
</if>
Expand Down
37 changes: 12 additions & 25 deletions netstandard/log4net.netstandard.sln
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29403.142
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "log4net", "log4net\log4net.xproj", "{00764202-B361-4BC8-A1B9-01D87F9D2D51}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "log4net.tests", "log4net.tests\log4net.tests.xproj", "{6A78D53B-C864-4316-AA00-F2EBFE975223}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4BB38D1C-1862-432B-881C-925714F7F997}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "log4net", "log4net\log4net.csproj", "{00764202-B361-4BC8-A1B9-01D87F9D2D51}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "log4net.tests", "log4net.tests\log4net.tests.csproj", "{6A78D53B-C864-4316-AA00-F2EBFE975223}"
ProjectSection(ProjectDependencies) = postProject
{00764202-B361-4BC8-A1B9-01D87F9D2D51} = {00764202-B361-4BC8-A1B9-01D87F9D2D51}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -50,4 +34,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {316D5265-B6A6-4270-9E1C-41BED3BF5E05}
EndGlobalSection
EndGlobal
32 changes: 32 additions & 0 deletions netstandard/log4net.tests/log4net.tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.0.9</VersionPrefix>
<TargetFramework>netcoreapp2.2</TargetFramework>
<DefineConstants>$(DefineConstants);NETSTANDARD1_3</DefineConstants>
<AssemblyName>log4net.tests</AssemblyName>
<PackageId>log4net.tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\tests\src\*.cs;..\..\tests\src\Appender\AppenderCollectionTest.cs;..\..\tests\src\Appender\BufferingAppenderTest.cs;..\..\tests\src\Appender\CountingAppender.cs;..\..\tests\src\Appender\MemoryAppenderTest.cs;..\..\tests\src\Appender\RollingFileAppenderTest.cs;..\..\tests\src\Appender\SmtpPickupDirAppenderTest.cs;..\..\tests\src\Appender\StringAppender.cs;..\..\tests\src\Appender\TraceAppenderTest.cs;..\..\tests\src\Context\LogicalThreadContextTest.cs;..\..\tests\src\Context\ThreadContextTest.cs;..\..\tests\src\Core\**\*.cs;..\..\tests\src\DateFormatter\**\*.cs;..\..\tests\src\Hierarchy\**\*.cs;..\..\tests\src\Layout\**\*.cs;..\..\tests\src\LoggerRepository\**\*.cs;..\..\tests\src\Util\CyclicBufferTest.cs;..\..\tests\src\Util\LogLogTest.cs;..\..\tests\src\Util\PatternConverterTest.cs;..\..\tests\src\Util\RandomStringPatternConverterTest.cs;..\..\tests\src\Util\SystemInfoTest.cs;..\..\tests\src\Util\TransformTest.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\log4net\log4net.csproj" />
</ItemGroup>

</Project>
63 changes: 0 additions & 63 deletions netstandard/log4net.tests/log4net.tests.xproj

This file was deleted.

45 changes: 0 additions & 45 deletions netstandard/log4net.tests/project.json

This file was deleted.

4 changes: 2 additions & 2 deletions netstandard/log4net/CompatibilityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
#endregion

#if NETSTANDARD1_3
#if NETSTANDARD1_3 || NETSTANDARD2_0

using System;
using System.Globalization;
Expand All @@ -41,7 +41,7 @@ internal static class CompatibilityExtensions
public static void Close(this WebResponse response) => response.Dispose();
public static void Close(this XmlWriter xmlWriter) => xmlWriter.Dispose();

public static Attribute[] GetCustomAttributes(this Type type, Type other, bool inherit) => type.GetTypeInfo().GetCustomAttributes(other, inherit).ToArray();
public static object[] GetCustomAttributes(this Type type, Type other, bool inherit) => type.GetTypeInfo().GetCustomAttributes(other, inherit).ToArray();
public static bool IsAssignableFrom(this Type type, Type other) => type.GetTypeInfo().IsAssignableFrom(other.GetTypeInfo());
public static bool IsSubclassOf(this Type type, Type t) => type.GetTypeInfo().IsSubclassOf(t);

Expand Down
67 changes: 67 additions & 0 deletions netstandard/log4net/log4net.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>Copyright 2004-2017 The Apache Software Foundation.</Copyright>
<AssemblyTitle>Apache log4net for .NET Core</AssemblyTitle>
<VersionPrefix>2.0.9</VersionPrefix>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<AssemblyName>log4net</AssemblyName>
<PackageId>log4net</PackageId>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);HAS_READERWRITERLOCKSLIM</DefineConstants>
<PublicSign>true</PublicSign>
<AssemblyOriginatorKeyFile>../../log4net.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\src\**\*.cs" Exclude="..\..\src\Appender\AdoNetAppender.cs;..\..\src\Appender\AspNetTraceAppender.cs;..\..\src\Appender\ColoredConsoleAppender.cs;..\..\src\Appender\EventLogAppender.cs;..\..\src\Appender\NetSendAppender.cs;..\..\src\Appender\RemotingAppender.cs;..\..\src\Appender\SmtpAppender.cs;..\..\src\Config\DOMConfigurator.cs;..\..\src\Config\DOMConfiguratorAttribute.cs;..\..\src\Config\Log4NetConfigurationSectionHandler.cs;..\..\src\Layout\Pattern\AspNetCachePatternConverter.cs;..\..\src\Layout\Pattern\AspNetContextPatternConverter.cs;..\..\src\Layout\Pattern\AspNetPatternConverter.cs;..\..\src\Layout\Pattern\AspNetRequestPatternConverter.cs;..\..\src\Layout\Pattern\AspNetSessionPatternConverter.cs;..\..\src\Layout\Pattern\StackTraceDetailPatternConverter.cs;..\..\src\Layout\Pattern\StackTracePatternConverter.cs;..\..\src\Plugin\RemoteLoggingServerPlugin.cs;..\..\src\Util\PatternStringConverters\AppSettingPatternConverter.cs;..\..\src\Util\PatternStringConverters\EnvironmentFolderPathPatternConverter.cs;..\..\src\Util\NativeError.cs;..\..\src\Util\WindowsSecurityContext.cs" />
</ItemGroup>

<ItemGroup>
<Compile Remove="..\..\src\obj\Debug\**" />
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.AppContext" Version="4.3.0" />
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
<PackageReference Include="System.Console" Version="4.3.1" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Watcher" Version="4.3.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="System.Threading" Version="4.3.0" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
<PackageReference Include="System.Threading.Timer" Version="4.3.0" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
</ItemGroup>

</Project>
Loading