Skip to content

Commit

Permalink
feat: enable support for .NET 8.0 (#389)
Browse files Browse the repository at this point in the history
Fixes #381 after implementing:
- #388 
- #387
- #386
- #385 
- #384 
- #383
- #382
  • Loading branch information
vbreuss authored Nov 14, 2023
1 parent b750be2 commit 5f46bf8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -74,6 +75,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -101,6 +103,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -128,6 +131,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -155,6 +159,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup VSTest
Expand All @@ -180,6 +185,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Build example solution
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-stryker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Stryker
shell: bash
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -53,6 +54,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -86,6 +88,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -153,6 +156,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Build example solution
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -112,6 +114,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -139,6 +142,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True --configuration "Release"
- name: Run tests
Expand Down Expand Up @@ -190,6 +194,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build solution
run: dotnet build /p:NetCoreOnly=True
- name: Build example solution
Expand All @@ -215,6 +220,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Stryker
shell: bash
run: |
Expand Down Expand Up @@ -242,6 +248,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Stryker
shell: bash
run: |
Expand Down Expand Up @@ -294,6 +301,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Prepare README.md
shell: bash
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stryker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Stryker
shell: bash
run: |
Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Stryker
shell: bash
run: |
Expand Down
5 changes: 4 additions & 1 deletion Feature.Flags.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<IS_NET21_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'netstandard2.1'">1</IS_NET21_OR_HIGHER>
<IS_NET6_OR_HIGHER Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0'">1</IS_NET6_OR_HIGHER>
<IS_NET7_OR_HIGHER Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0'">1</IS_NET7_OR_HIGHER>

<IS_NET8_OR_HIGHER Condition="'$(TargetFramework)' == 'net8.0'">1</IS_NET8_OR_HIGHER>

<DefineConstants Condition="'$(TargetFramework)' == 'net48' OR '$(TargetFramework)' == 'netstandard2.0'">$(DefineConstants);NETFRAMEWORK</DefineConstants>
<DefineConstants Condition="'$(IS_NET21_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_FILESYSTEM_ASYNC</DefineConstants>
<DefineConstants Condition="'$(IS_NET21_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_FILESYSTEM_ENUMERATION_OPTIONS</DefineConstants>
Expand All @@ -28,6 +29,8 @@
<DefineConstants Condition="'$(IS_NET7_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_FILESYSTEM_SAFEFILEHANDLE</DefineConstants>
<DefineConstants Condition="'$(IS_NET7_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_FILESYSTEM_UNIXFILEMODE</DefineConstants>
<DefineConstants Condition="'$(IS_NET7_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_GUID_FORMATPROVIDER</DefineConstants>
<DefineConstants Condition="'$(IS_NET8_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_RANDOM_ITEMS</DefineConstants>
<DefineConstants Condition="'$(IS_NET8_OR_HIGHER)' == '1'">$(DefineConstants);FEATURE_COMPRESSION_STREAM</DefineConstants>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(NetFrameworkOnly)' == 'True'">netstandard2.0</TargetFrameworks>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Feature.Flags.props', '$(MSBuildThisFileDirectory)/../'))" />

<PropertyGroup>
<TargetFrameworks Condition="'$(NetCoreOnly)' != 'True'">net6.0;net7.0;net48</TargetFrameworks>
<TargetFrameworks Condition="'$(NetCoreOnly)' == 'True'">net6.0;net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(NetCoreOnly)' != 'True'">net6.0;net7.0;net8.0;net48</TargetFrameworks>
<TargetFrameworks Condition="'$(NetCoreOnly)' == 'True'">net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(NetFrameworkOnly)' == 'True'">net48</TargetFrameworks>
</PropertyGroup>

Expand Down
18 changes: 18 additions & 0 deletions Tests/Testably.Abstractions.Parity.Tests/Net8ParityTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#if NET8_0
using System.IO;
using Xunit.Abstractions;

namespace Testably.Abstractions.Parity.Tests;

// ReSharper disable once UnusedMember.Global
public class Net8ParityTests : ParityTests
{
public Net8ParityTests(ITestOutputHelper testOutputHelper)
: base(new TestHelpers.Parity(), testOutputHelper)
{
Parity.File.MissingMethods.Add(
typeof(File).GetMethod(nameof(File.OpenHandle)));
}
}

#endif

0 comments on commit 5f46bf8

Please sign in to comment.