From bed2932b30487e669c6b93a10da51098a3fbcc7d Mon Sep 17 00:00:00 2001 From: Flash0ver <38893694+Flash0ver@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:53:46 +0100 Subject: [PATCH] feat: target .NET 8.0 --- .gitignore | 10 ++++++++-- global.json | 2 +- .../FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj | 2 +- .../FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj | 2 +- .../CodeAnalysis/LanguageVersionExtensions.cs | 1 + .../FlashOWare.Tool.Cli.Tests.csproj | 2 +- src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs | 2 ++ .../Testing/TargetFramework.cs | 6 +++++- .../FlashOWare.Tool.Core.Tests.csproj | 2 +- src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj | 2 +- 10 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 5a64a0b..8a680b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -398,8 +401,8 @@ FodyWeavers.xsd *.msp # JetBrains Rider -.idea/ *.sln.iml +.idea ## ## Visual studio for Mac @@ -477,6 +480,9 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# Vim temporary swap files +*.swp + # NUKE .nuke/temp/ .nuke/build.schema.json diff --git a/global.json b/global.json index b887553..3f809cb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "feature" } } diff --git a/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj b/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj index d781b6c..cb8b68c 100644 --- a/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj +++ b/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj @@ -2,7 +2,7 @@ Library - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable diff --git a/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj b/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj index 2cbb7c1..0105896 100644 --- a/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj +++ b/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj @@ -2,7 +2,7 @@ Library - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs b/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs index 4b75bae..a287718 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs @@ -19,6 +19,7 @@ public static LanguageVersion DefaultIfNull(this LanguageVersion? langVersion, T TargetFramework.NetStandard20 => LanguageVersion.CSharp7_3, TargetFramework.Net60 => LanguageVersion.CSharp10, TargetFramework.Net70 => LanguageVersion.CSharp11, + TargetFramework.Net80 => (LanguageVersion)1200, TargetFramework.Latest => LanguageVersion.Latest, _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj b/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj index ed885de..e1c125a 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj +++ b/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs index a7cbfe9..c7cd9fe 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs @@ -21,6 +21,8 @@ private static string GetTargetFrameworkMoniker() return "net6.0"; #elif NET7_0 return "net7.0"; +#elif NET8_0 + return "net8.0"; #else #error TFM not implemented. #endif diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs index a60fbe8..680fb9f 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs @@ -9,6 +9,7 @@ internal enum TargetFramework NetStandard20, Net60, Net70, + Net80, Latest, } @@ -23,7 +24,8 @@ public static string ToMonikerString(this TargetFramework tfm) TargetFramework.NetStandard20 => "netstandard2.0", TargetFramework.Net60 => "net6.0", TargetFramework.Net70 => "net7.0", - TargetFramework.Latest => "net7.0", + TargetFramework.Net80 => "net8.0", + TargetFramework.Latest => "net8.0", _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; } @@ -56,6 +58,7 @@ public static string ToTargetFrameworkVersionString(this TargetFramework targetF TargetFramework.NetStandard20 => throw new NotSupportedException(".NET Standard 2.0 is not supported."), TargetFramework.Net60 => throw new NotSupportedException(".NET 6.0 is not supported."), TargetFramework.Net70 => throw new NotSupportedException(".NET 7.0 is not supported."), + TargetFramework.Net80 => throw new NotSupportedException(".NET 8.0 is not supported."), TargetFramework.Latest => throw new NotSupportedException($"{nameof(TargetFramework)} 'latest' is not supported."), _ => throw new InvalidEnumArgumentException(nameof(targetFrameworkVersion), (int)targetFrameworkVersion, typeof(TargetFramework)), }; @@ -69,6 +72,7 @@ public static bool IsDotNetFramework(this TargetFramework tfm) TargetFramework.NetStandard20 => false, TargetFramework.Net60 => false, TargetFramework.Net70 => false, + TargetFramework.Net80 => false, TargetFramework.Latest => false, _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; diff --git a/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj b/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj index e6a6262..8dbb545 100644 --- a/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj +++ b/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable diff --git a/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj b/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj index e1a5e0c..2a61e3c 100644 --- a/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj +++ b/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj @@ -2,7 +2,7 @@ Exe - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable