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

feat: enable support for .NET 8.0 #389

Merged
merged 8 commits into from
Nov 14, 2023
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
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
Loading