Skip to content

Commit

Permalink
Merge pull request #158 from maxmind/greg/no-net5.0-target
Browse files Browse the repository at this point in the history
Remove NET 5.0 target
  • Loading branch information
ugexe authored Nov 16, 2023
2 parents b4b562c + b6ad9a5 commit 1bf9d8e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 25 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ jobs:
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Setup .NET 6.0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.*
dotnet-version: |
6.0.x
7.0.x
8.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@ jobs:
with:
submodules: true

- name: Setup dotnet 3.1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1

- name: Setup .NET 5.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.*

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.*
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: |
Expand All @@ -39,7 +32,7 @@ jobs:
dotnet build MaxMind.Db.Test
- name: Run benchmark
run: dotnet run -f netcoreapp3.1 -p MaxMind.Db.Benchmark/MaxMind.Db.Benchmark.csproj
run: dotnet run -f net8.0 --project MaxMind.Db.Benchmark/MaxMind.Db.Benchmark.csproj
env:
MAXMIND_BENCHMARK_DB: ${{ github.workspace }}/MaxMind.Db.Test/TestData/MaxMind-DB/test-data/GeoIP2-City-Test.mmdb

Expand Down
4 changes: 2 additions & 2 deletions MaxMind.Db.Benchmark/MaxMind.Db.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<Description>Benchmark project to validate .NET reader for the MaxMind DB file format</Description>
<VersionPrefix>4.0.0</VersionPrefix>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net6.0;net5.0;net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net8.0;net7.0;net6.0;net472</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">net8.0;net7.0;net6.0</TargetFrameworks>
<AssemblyName>MaxMind.Db.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>MaxMind.Db.Benchmark</PackageId>
Expand Down
4 changes: 2 additions & 2 deletions MaxMind.Db.Test/MaxMind.Db.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<Description>Test project to validate .NET reader for the MaxMind DB file format</Description>
<VersionPrefix>4.0.0</VersionPrefix>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net6.0;net5.0;net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net8.0;net7.0;net6.0;net472</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">net8.0;net7.0;net6.0</TargetFrameworks>
<AssemblyName>MaxMind.Db.Test</AssemblyName>
<AssemblyOriginatorKeyFile>../MaxMind.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down
10 changes: 5 additions & 5 deletions MaxMind.Db.Test/ReaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task TestAsync()
{
var file = Path.Combine(_testDataRoot,
"MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb");
var reader = await Reader.CreateAsync(file).ConfigureAwait(false);
var reader = await Reader.CreateAsync(file);
using (reader)
{
TestMetadata(reader, ipVersion);
Expand Down Expand Up @@ -110,7 +110,7 @@ public async Task TestStreamAsync()
var file = Path.Combine(_testDataRoot,
"MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb");
using var streamReader = File.OpenText(file);
using var reader = await Reader.CreateAsync(streamReader.BaseStream).ConfigureAwait(false);
using var reader = await Reader.CreateAsync(streamReader.BaseStream);
TestMetadata(reader, ipVersion);

if (ipVersion == 4)
Expand Down Expand Up @@ -162,7 +162,7 @@ public async Task TestNonSeekableStreamAsync()
"MaxMind-DB-test-ipv" + ipVersion + "-" + recordSize + ".mmdb");

using var stream = new NonSeekableStreamWrapper(File.OpenRead(file));
using var reader = await Reader.CreateAsync(stream).ConfigureAwait(false);
using var reader = await Reader.CreateAsync(stream);
TestMetadata(reader, ipVersion);

if (ipVersion == 4)
Expand Down Expand Up @@ -192,7 +192,7 @@ public void NullStreamThrowsArgumentNullException()
public void NullStreamThrowsArgumentNullExceptionAsync()
{
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
((Func<Task>)(async () => await Reader.CreateAsync((Stream)null).ConfigureAwait(false)))
((Func<Task>)(async () => await Reader.CreateAsync((Stream)null)))
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
.Should().ThrowExactlyAsync<ArgumentNullException>()
.WithMessage("The database stream must not be null.*");
Expand All @@ -212,7 +212,7 @@ public void TestEmptyStream()
public void TestEmptyStreamAsync()
{
using var stream = new MemoryStream();
((Func<Task>)(async () => await Reader.CreateAsync(stream).ConfigureAwait(false)))
((Func<Task>)(async () => await Reader.CreateAsync(stream)))
.Should().ThrowExactlyAsync<InvalidDatabaseException>()
.WithMessage("*zero bytes left in the stream*");
}
Expand Down
3 changes: 3 additions & 0 deletions MaxMind.Db/DeserializationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public DeserializationException(string message, Exception innerException)
/// </summary>
/// <param name="info">The SerializationInfo with data.</param>
/// <param name="context">The source for this deserialization.</param>
#if NET8_0_OR_GREATER
[Obsolete(DiagnosticId = "SYSLIB0051")]
#endif
private DeserializationException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
Expand Down
3 changes: 3 additions & 0 deletions MaxMind.Db/InvalidDatabaseException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public InvalidDatabaseException(string message, Exception innerException)
/// </summary>
/// <param name="info">The SerializationInfo with data.</param>
/// <param name="context">The source for this deserialization.</param>
#if NET8_0_OR_GREATER
[Obsolete(DiagnosticId = "SYSLIB0051")]
#endif
private InvalidDatabaseException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
Expand Down
2 changes: 1 addition & 1 deletion MaxMind.Db/MaxMind.Db.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>.NET reader for the MaxMind DB file format</Description>
<VersionPrefix>4.0.0</VersionPrefix>
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>MaxMind.Db</AssemblyName>
<AssemblyOriginatorKeyFile>../MaxMind.snk</AssemblyOriginatorKeyFile>
Expand Down
7 changes: 7 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes #

## 4.1.0

* .NET 5.0 has been removed as a target as it has reach its end of life.
However, if you are using .NET 5.0, the .NET Standard 2.1 target should
continue working for you.
* .NET 7.0 and .NET 8.0 have been added as a target.

## 4.0.0 (2022-02-03) ##

* This library no longer targets .NET 4.6.1.
Expand Down

0 comments on commit 1bf9d8e

Please sign in to comment.