Skip to content

Commit 99fef40

Browse files
authored
drop .NET Core 2.1 and .NET Framework 4.5.2/4.6.1 (#11)
* drop .NET Core 2.1 and .NET Framework 4.5.2/4.6.1 * fix CI * update release metadata * enable test logger for CircleCI reporting * store test results
1 parent b92d82e commit 99fef40

File tree

6 files changed

+73
-48
lines changed

6 files changed

+73
-48
lines changed

.circleci/config.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
version: 2.1
22

3+
orbs:
4+
win: circleci/windows@1.0.0
5+
36
workflows:
47
version: 2
58
test:
69
jobs:
7-
- build-netstandard-netcore
8-
- test-netcore:
9-
name: .NET Core 2.1
10-
docker-image: mcr.microsoft.com/dotnet/core/sdk:2.1-focal
11-
test-target-framework: netcoreapp2.1
12-
requires:
13-
- build-netstandard-netcore
14-
- test-netcore:
15-
name: .NET Core 2.1 library running in .NET Core 3.1
10+
- build_all
11+
- test_linux:
12+
name: .NET Core 3.1
1613
docker-image: mcr.microsoft.com/dotnet/core/sdk:3.1-focal
1714
test-target-framework: netcoreapp3.1
1815
requires:
19-
- build-netstandard-netcore
20-
- test-netcore:
21-
name: .NET Core 2.1 library running in .NET 5.0
22-
docker-image: mcr.microsoft.com/dotnet/sdk:5.0-focal
23-
test-target-framework: net5.0
16+
- build_all
17+
- test_linux:
18+
name: .NET Core 3.1 library running in .NET 6.0
19+
docker-image: mcr.microsoft.com/dotnet/sdk:6.0-focal
20+
test-target-framework: net6.0
2421
requires:
25-
- build-netstandard-netcore
26-
- test-windows-netframework-4-5-2
27-
28-
orbs:
29-
win: circleci/windows@1.0.0
22+
- build_all
23+
- test_windows
3024

3125
jobs:
32-
build-netstandard-netcore:
26+
build_all:
3327
docker:
34-
- image: mcr.microsoft.com/dotnet/core/sdk:2.1-focal
28+
- image: mcr.microsoft.com/dotnet/core/sdk:3.1-focal
3529
environment:
3630
ASPNETCORE_SUPPRESSSTATUSMESSAGES: true
3731
steps:
@@ -43,15 +37,15 @@ jobs:
4337
name: build .NET Standard 2.0
4438
command: dotnet build src/LaunchDarkly.Logging -f netstandard2.0
4539
- run:
46-
name: build .NET Core 2.1
47-
command: dotnet build src/LaunchDarkly.Logging -f netcoreapp2.1
40+
name: build .NET Core 3.1
41+
command: dotnet build src/LaunchDarkly.Logging -f netcoreapp3.1
4842
- persist_to_workspace:
4943
root: src/LaunchDarkly.Logging
5044
paths:
5145
- bin
5246
- obj
5347

54-
test-netcore:
48+
test_linux:
5549
parameters:
5650
docker-image:
5751
type: string
@@ -68,29 +62,41 @@ jobs:
6862
at: src/LaunchDarkly.Logging
6963
- run:
7064
name: run tests
71-
command: dotnet test test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj -f <<parameters.test-target-framework>>
65+
command: |
66+
dotnet test \
67+
-l "junit;LogFilePath=/tmp/circle-reports/unit-tests-commonsdk.xml" \
68+
-f <<parameters.test-target-framework>> \
69+
test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj
70+
- store_test_results:
71+
path: /tmp/circle-reports
7272

73-
test-windows-netframework-4-5-2:
73+
test_windows:
7474
executor:
7575
name: win/vs2019
7676
shell: powershell.exe
7777
environment:
78-
TESTFRAMEWORK: net452
78+
BUILDFRAMEWORKS: net462
79+
TESTFRAMEWORK: net462
7980
steps:
8081
- checkout
8182
- restore_cache:
8283
keys:
83-
- net452-deps-{{ checksum "src/LaunchDarkly.Logging/LaunchDarkly.Logging.csproj" }}-{{ checksum "test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj" }}
84+
- net462-deps-{{ checksum "src/LaunchDarkly.Logging/LaunchDarkly.Logging.csproj" }}-{{ checksum "test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj" }}
8485
- run:
8586
name: install project dependencies
8687
command: dotnet restore
8788
- save_cache:
88-
key: net452-deps-{{ checksum "src/LaunchDarkly.Logging/LaunchDarkly.Logging.csproj" }}-{{ checksum "test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj" }}
89+
key: net462-deps-{{ checksum "src/LaunchDarkly.Logging/LaunchDarkly.Logging.csproj" }}-{{ checksum "test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj" }}
8990
paths:
9091
- C:\Users\circleci\.nuget\packages
9192
- run:
9293
name: build
93-
command: dotnet build src/LaunchDarkly.Logging -f net452
94+
command: dotnet build src/LaunchDarkly.Logging -f net462
9495
- run:
9596
name: run tests
96-
command: dotnet test test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj -f net452
97+
command: |
98+
dotnet test \
99+
-l "junit;LogFilePath=/tmp/circle-reports/unit-tests-commonsdk.xml" \
100+
test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj
101+
- store_test_results:
102+
path: /tmp/circle-reports

.ldrelease/config.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ publications:
77
jobs:
88
- docker: {}
99
template:
10-
name: dotnet-linux
10+
name: dotnet6-linux
1111
env:
12-
LD_RELEASE_TEST_TARGET_FRAMEWORK: net50
13-
LD_RELEASE_DOCS_TARGET_FRAMEWORK: netcoreapp2.1 # so the docs will include Logs.CoreLogging
12+
LD_RELEASE_TEST_TARGET_FRAMEWORK: net6.0
13+
LD_RELEASE_DOCS_TARGET_FRAMEWORK: netcoreapp3.1 # so the docs will include Logs.CoreLogging
14+
15+
branches:
16+
- name: main
17+
- name: 1.x
1418

1519
documentation:
1620
title: LaunchDarkly Logging API for .NET

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ For more information and examples, see the [API documentation](https://launchdar
1212

1313
This version of the library is built for the following targets:
1414

15-
* .NET Framework 4.5.2: runs on .NET Framework 4.5.x and above.
16-
* .NET Core 2.1: runs on .NET Core 2.x and 3.x, or .NET 5. This target provides an adapter to the standard .NET Core logging framework, `Logs.CoreLogging`, which is not available in .NET Framework.
15+
* .NET Framework 4.6.2: runs on .NET Framework 4.6.2 and above.
16+
* .NET Core 3.1: runs on .NET Core 3.x, or .NET 6.0+. This target provides an adapter to the standard .NET Core logging framework, `Logs.CoreLogging`, which is not available in .NET Framework except as a separate package.
1717
* .NET Standard 2.0: runs on application platforms that are neither of the above, such as Xamarin, or within a library that is targeted to .NET Standard 2.x.
1818

1919
The .NET build tools should automatically load the most appropriate build of the library for whatever platform your application or library is targeted to.

src/LaunchDarkly.Logging/LaunchDarkly.Logging.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Version>1.0.1</Version>
4-
<TargetFrameworks>netstandard2.0;netcoreapp2.1;net452</TargetFrameworks>
4+
<!--
5+
The reason there's a mechanism here for overriding the target frameworks with
6+
an environment variable is that we want to be able to run CI tests using .NET
7+
SDKs that may not support all of these target frameworks.
8+
-->
9+
<BuildFrameworks Condition="'$(BUILDFRAMEWORKS)' == ''">netstandard2.0;netcoreapp3.1;net462</BuildFrameworks>
10+
<TargetFrameworks>$(BUILDFRAMEWORKS)</TargetFrameworks>
511
<DebugType>portable</DebugType>
612
<AssemblyName>LaunchDarkly.Logging</AssemblyName>
713
<OutputType>Library</OutputType>
@@ -21,8 +27,8 @@
2127
<WarningsAsErrors>1570,1571,1572,1573,1574,1580,1581,1584,1591,1710,1711,1712</WarningsAsErrors>
2228
</PropertyGroup>
2329

24-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
25-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.9" />
30+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
31+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
2632
</ItemGroup>
2733

2834
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

src/LaunchDarkly.Logging/Logs.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static SimpleLogging ToMethod(Action<string> writeLineMethod) =>
102102
/// </summary>
103103
/// <remarks>
104104
/// <para>
105-
/// This method is only available when your target framework is .NET Core. It causes
105+
/// This method is only available when your target framework is .NET Core or .NET 6.0+. It causes
106106
/// the <c>LaunchDarkly.Logging</c> APIs to delegate to the <c>Microsoft.Extensions.Logging</c>
107107
/// framework. The <c>ILoggingFactory</c> is the main configuration object for
108108
/// <c>Microsoft.Extensions.Logging</c>; application code can construct it programmatically,
@@ -111,6 +111,14 @@ public static SimpleLogging ToMethod(Action<string> writeLineMethod) =>
111111
/// in .NET Core and ASP.NET Core</see>.
112112
/// </para>
113113
/// <para>
114+
/// If you want to use <c>Microsoft.Extensions.Logging</c> on a different platform, such as
115+
/// .NET Framework or a mobile OS, use the separate package
116+
/// <a href="https://github.com/launchdarkly/dotnet-logging-adapter-ms">LaunchDarkly.Logging.Microsoft</a>.
117+
/// The adapter is not built into <c>LaunchDarkly.Logging</c> on those platforms, to avoid
118+
/// bringing in the <c>Microsoft.Extensions.Logging</c> package as a dependency that may not
119+
/// be wanted.
120+
/// </para>
121+
/// <para>
114122
/// The .NET Core logging framework has its own mechanisms for filtering log output
115123
/// by level or other criteria. If you add a level filter with
116124
/// <see cref="ILogAdapterExtensions.Level(ILogAdapter, LogLevel)"/>, it will filter

test/LaunchDarkly.Logging.Tests/LaunchDarkly.Logging.Tests.csproj

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">netcoreapp2.1;net5.0</TestFramework>
3+
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">netcoreapp3.1;net6.0</TestFramework>
44
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
55
<AssemblyName>LaunchDarkly.Logging.Tests</AssemblyName>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
10-
<PackageReference Include="xunit" Version="2.4.1" />
11-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
10+
<PackageReference Include="xunit" Version="2.4.2" />
11+
<PackageReference Include="xunit.runner.console" Version="2.4.2" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
13+
<PackageReference Include="JunitXml.TestLogger" Version="3.0.114" />
1214
</ItemGroup>
1315

14-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'
15-
or '$(TargetFramework)' == 'netcoreapp3.1'
16-
or '$(TargetFramework)' == 'net5.0' ">
17-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.9" />
16+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1'
17+
or '$(TargetFramework)' == 'net6.0' ">
18+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
1819
</ItemGroup>
1920

2021
<ItemGroup>

0 commit comments

Comments
 (0)