From 2e4668dbe5ba592088905f4c6f9547d6d5ebea60 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:08:09 -0800 Subject: [PATCH] feat: Updates to .NET 8. (#1542) ### Breaking Changes - Updating to .NET 8 - Required O/S's have slightly changed. --- .config/dotnet-tools.json | 2 +- .github/workflows/build-test.yml | 14 ++++++++++---- .github/workflows/create-release.yml | 4 ++-- Directory.Build.props | 4 ++-- Projects/Server.Tests/Server.Tests.csproj | 5 ++++- Projects/Server/Buffers/SpanWriter.cs | 2 +- Projects/Server/Server.csproj | 6 +++--- Projects/Server/Text/OrdinalStringHelpers.cs | 6 +++--- Projects/Server/Utilities/Utility.cs | 1 - Projects/UOContent.Tests/UOContent.Tests.csproj | 5 ++++- Projects/UOContent/Accounting/Firewall.cs | 2 +- .../UOContent/Commands/Object Creation/Decorate.cs | 5 +++-- .../Commands/Object Creation/DecorateMag.cs | 5 +++-- .../Network/Packets/IncomingPlayerPackets.cs | 2 +- .../Special Systems/Engines/TestCenter.cs | 2 +- Projects/UOContent/UOContent.csproj | 7 ++++--- Projects/UOContent/World Saves/AutoArchive.cs | 2 +- README.md | 10 +++++----- azure-pipelines.yml | 4 ++-- docs/installation.md | 6 +++--- global.json | 2 +- version.json | 2 +- 22 files changed, 56 insertions(+), 42 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ab09f794e..4026539bf 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "modernuoschemagenerator": { - "version": "2.7.2", + "version": "2.8.0", "commands": [ "ModernUOSchemaGenerator" ] diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4e6c66a91..af46380a8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -23,10 +23,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - name: Setup .NET 7 + - name: Setup .NET 8 uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build run: ./publish.cmd Release - name: Migration Changes @@ -45,12 +45,18 @@ jobs: - container: ubuntu:jammy name: Ubuntu 22 packageManager: apt + - container: ubuntu:focal + name: Ubuntu 20 + packageManager: apt - container: debian:bookworm name: Debian 12 packageManager: apt - container: debian:bullseye name: Debian 11 packageManager: apt + - container: fedora:39 + name: Fedora 39 + packageManager: dnf - container: fedora:38 name: Fedora 38 packageManager: dnf @@ -77,10 +83,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - name: Setup .NET 7 + - name: Setup .NET 8 uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build run: ./publish.sh Release - name: Test diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index efd86e385..dc1598202 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -14,10 +14,10 @@ jobs: with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - name: Setup .NET 7 + - name: Setup .NET 8 uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Install NGBV uses: dotnet/nbgv@master id: nbgv diff --git a/Directory.Build.props b/Directory.Build.props index 0712c42a0..35456bd02 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,8 @@ Kamron Batman ModernUO 2019-2023 - net7.0 - 11 + net8.0 + 12 true true NU1603 diff --git a/Projects/Server.Tests/Server.Tests.csproj b/Projects/Server.Tests/Server.Tests.csproj index 6a9b32e02..710cb993f 100644 --- a/Projects/Server.Tests/Server.Tests.csproj +++ b/Projects/Server.Tests/Server.Tests.csproj @@ -6,7 +6,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Projects/Server/Buffers/SpanWriter.cs b/Projects/Server/Buffers/SpanWriter.cs index c99c6b9ea..b40b19e15 100644 --- a/Projects/Server/Buffers/SpanWriter.cs +++ b/Projects/Server/Buffers/SpanWriter.cs @@ -19,7 +19,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server; using Server.Buffers; using Server.Text; diff --git a/Projects/Server/Server.csproj b/Projects/Server/Server.csproj index d757db0f5..377ca0535 100755 --- a/Projects/Server/Server.csproj +++ b/Projects/Server/Server.csproj @@ -22,7 +22,7 @@ - + @@ -32,12 +32,12 @@ - + - + diff --git a/Projects/Server/Text/OrdinalStringHelpers.cs b/Projects/Server/Text/OrdinalStringHelpers.cs index 172e8dbe2..c1d7f5ba1 100644 --- a/Projects/Server/Text/OrdinalStringHelpers.cs +++ b/Projects/Server/Text/OrdinalStringHelpers.cs @@ -37,7 +37,7 @@ public static class OrdinalStringHelpers [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool StartsWithOrdinal(this ReadOnlySpan a, char b) => - a.StartsWithOrdinal(new ReadOnlySpan(b)); + a.StartsWithOrdinal(new ReadOnlySpan(ref b)); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool StartsWithOrdinal(this ReadOnlySpan a, ReadOnlySpan b) => @@ -52,7 +52,7 @@ public static class OrdinalStringHelpers a?.EndsWith(b, StringComparison.Ordinal) == true; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool EndsWithOrdinal(this ReadOnlySpan a, char b) => a.EndsWithOrdinal(new ReadOnlySpan(b)); + public static bool EndsWithOrdinal(this ReadOnlySpan a, char b) => a.EndsWithOrdinal(new ReadOnlySpan(ref b)); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EndsWithOrdinal(this ReadOnlySpan a, ReadOnlySpan b) => @@ -86,7 +86,7 @@ public static class OrdinalStringHelpers [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int IndexOfOrdinal(this ReadOnlySpan a, char b) => - a.IndexOfOrdinal(new ReadOnlySpan(b)); + a.IndexOfOrdinal(new ReadOnlySpan(ref b)); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int IndexOfOrdinal(this ReadOnlySpan a, ReadOnlySpan b) => diff --git a/Projects/Server/Utilities/Utility.cs b/Projects/Server/Utilities/Utility.cs index c00aea215..b3f2e965b 100644 --- a/Projects/Server/Utilities/Utility.cs +++ b/Projects/Server/Utilities/Utility.cs @@ -8,7 +8,6 @@ using System.Net.Sockets; using System.Runtime.CompilerServices; using System.Text; using System.Xml; -using Microsoft.Toolkit.HighPerformance; using Server.Buffers; using Server.Collections; using Server.Logging; diff --git a/Projects/UOContent.Tests/UOContent.Tests.csproj b/Projects/UOContent.Tests/UOContent.Tests.csproj index 1d6f0ac30..002a1b64f 100644 --- a/Projects/UOContent.Tests/UOContent.Tests.csproj +++ b/Projects/UOContent.Tests/UOContent.Tests.csproj @@ -6,7 +6,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Projects/UOContent/Accounting/Firewall.cs b/Projects/UOContent/Accounting/Firewall.cs index d1deaf097..88ea0471e 100644 --- a/Projects/UOContent/Accounting/Firewall.cs +++ b/Projects/UOContent/Accounting/Firewall.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Net; using System.Runtime.CompilerServices; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; namespace Server { diff --git a/Projects/UOContent/Commands/Object Creation/Decorate.cs b/Projects/UOContent/Commands/Object Creation/Decorate.cs index 426d1ed87..c15509f59 100644 --- a/Projects/UOContent/Commands/Object Creation/Decorate.cs +++ b/Projects/UOContent/Commands/Object Creation/Decorate.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server.Collections; using Server.Engines.Quests.Haven; using Server.Engines.Quests.Necro; @@ -9,6 +9,7 @@ using Server.Engines.Spawners; using Server.Items; using Server.Network; using Server.Utilities; +using MemoryExtensions = System.MemoryExtensions; namespace Server.Commands { @@ -1266,7 +1267,7 @@ namespace Server.Commands } else { - list.m_Params = new string[parms.Count(';') + 1]; + list.m_Params = new string[MemoryExtensions.Count(parms, ';') + 1]; indexOf = 0; foreach (var part in parms.Tokenize(';')) diff --git a/Projects/UOContent/Commands/Object Creation/DecorateMag.cs b/Projects/UOContent/Commands/Object Creation/DecorateMag.cs index 6cd025e73..bc6d12650 100644 --- a/Projects/UOContent/Commands/Object Creation/DecorateMag.cs +++ b/Projects/UOContent/Commands/Object Creation/DecorateMag.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server.Collections; using Server.Engines.Quests.Haven; using Server.Engines.Quests.Necro; @@ -9,6 +9,7 @@ using Server.Engines.Spawners; using Server.Items; using Server.Network; using Server.Utilities; +using MemoryExtensions = System.MemoryExtensions; namespace Server.Commands { @@ -1252,7 +1253,7 @@ namespace Server.Commands } else { - list.m_Params = new string[parms.Count(';') + 1]; + list.m_Params = new string[MemoryExtensions.Count(parms, ';') + 1]; indexOf = 0; foreach (var part in parms.Tokenize(';')) diff --git a/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs b/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs index a08b4d38e..8c1ed8721 100644 --- a/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs +++ b/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs @@ -15,7 +15,7 @@ using System.Buffers; using System.Diagnostics; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server.Diagnostics; using Server.Engines.Virtues; using Server.Exceptions; diff --git a/Projects/UOContent/Special Systems/Engines/TestCenter.cs b/Projects/UOContent/Special Systems/Engines/TestCenter.cs index 962c57761..f9fceeb8a 100644 --- a/Projects/UOContent/Special Systems/Engines/TestCenter.cs +++ b/Projects/UOContent/Special Systems/Engines/TestCenter.cs @@ -1,6 +1,6 @@ using System; using System.Text; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server.Commands; using Server.Factions; using Server.Gumps; diff --git a/Projects/UOContent/UOContent.csproj b/Projects/UOContent/UOContent.csproj index 381763372..0f41eca5d 100644 --- a/Projects/UOContent/UOContent.csproj +++ b/Projects/UOContent/UOContent.csproj @@ -14,6 +14,7 @@ + @@ -32,13 +33,13 @@ false - - + + - + diff --git a/Projects/UOContent/World Saves/AutoArchive.cs b/Projects/UOContent/World Saves/AutoArchive.cs index 801cea14c..0558c581b 100755 --- a/Projects/UOContent/World Saves/AutoArchive.cs +++ b/Projects/UOContent/World Saves/AutoArchive.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Server.Compression; using Server.Logging; diff --git a/README.md b/README.md index 228c3c326..a96240b01 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ ModernUO [![Discord](https://img.shields.io/discord/751317910504603701?logo=disc #### Supported Operating Systems [![Windows 10/11/2019/2022](https://img.shields.io/badge/-server%202022-0078D6?logo=windows&logoColor=0078D6&labelColor=222222)](https://www.microsoft.com/en-US/evalcenter/evaluate-windows-server-2022) ![MacOS 11+](https://img.shields.io/badge/-ventura-222222?logo=apple&logoColor=white&labelColor=222222) -[![Debian 10+](https://img.shields.io/badge/-bookworm-A81D33?logo=debian&logoColor=A81D33&labelColor=222222)](https://www.debian.org/distrib/) -[![Ubuntu 16+ LTS](https://img.shields.io/badge/-22LTS-E95420?logo=ubuntu&logoColor=E95420&labelColor=222222)](https://ubuntu.com/download/server) +[![Debian 11+](https://img.shields.io/badge/-bookworm-A81D33?logo=debian&logoColor=A81D33&labelColor=222222)](https://www.debian.org/distrib/) +[![Ubuntu 20+ LTS](https://img.shields.io/badge/-22LTS-E95420?logo=ubuntu&logoColor=E95420&labelColor=222222)](https://ubuntu.com/download/server)
[![Alpine 3.18+](https://img.shields.io/badge/-3.18-0D597F?logo=alpinelinux&logoColor=0D597F&labelColor=222222)](https://alpinelinux.org/downloads/) -[![Fedora 33+](https://img.shields.io/badge/-38-51a2da?logo=fedora&logoColor=51a2da&labelColor=222222)](https://getfedora.org/en/server/download/) +[![Fedora 37+](https://img.shields.io/badge/-38-51a2da?logo=fedora&logoColor=51a2da&labelColor=222222)](https://getfedora.org/en/server/download/) [![RedHat 7/8](https://img.shields.io/badge/-8-BE0000?logo=redhat&logoColor=BE0000&labelColor=222222)](https://access.redhat.com/downloads) [![CentOS 7/8/9](https://img.shields.io/badge/-9-262577?logo=centos&logoColor=white&labelColor=222222)](https://www.centos.org/download/) [![openSUSE 15+](https://img.shields.io/badge/-15-73BA25?logo=openSUSE&logoColor=73BA25&labelColor=222222)](https://get.opensuse.org/) @@ -31,14 +31,14 @@ ModernUO [![Discord](https://img.shields.io/discord/751317910504603701?logo=disc #### Required Frameworks ##### All Operating Systems -[![.NET](https://img.shields.io/badge/-7.0.11-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) +[![.NET](https://img.shields.io/badge/-8.0.0-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) ##### Windows [![VC++ Redistributable 17](https://img.shields.io/badge/-Redist%2017-00599C?logo=cplusplus&logoColor=white&labelColor=222222)](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022) #### Development [![git](https://img.shields.io/badge/-git-F05032?logo=git&logoColor=F05032&labelColor=222222)](https://git-scm.com/downloads) -[![.NET](https://img.shields.io/badge/-%207.0.401%20SDK-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) +[![.NET](https://img.shields.io/badge/-%208.0.100%20SDK-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) #### Supported IDEs diff --git a/azure-pipelines.yml b/azure-pipelines.yml index efab248e3..a6471d135 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,10 +15,10 @@ jobs: steps: - task: UseDotNet@2 - displayName: 'Install .NET 7' + displayName: 'Install .NET 8' inputs: packageType: sdk - version: '7.0.x' + version: '8.0.x' - task: NuGetAuthenticate@1 - script: ./publish.cmd Release displayName: 'Build' diff --git a/docs/installation.md b/docs/installation.md index 817f5207d..ff6d90c8b 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -6,7 +6,7 @@ title: Installation === "Windows" ### Prerequisites - 1. Download and install the latest [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0) + 1. Download and install the latest [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) 1. Download and install from [here](https://git-scm.com/download/win) !!! Tip @@ -22,7 +22,7 @@ title: Installation === "OSX" ### Prerequisites - 1. Download and install the latest [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0). + 1. Download and install the latest [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0). 1. Using _terminal_, install [homebrew](https://brew.sh) and git: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" @@ -37,7 +37,7 @@ title: Installation === "Linux" ### Prerequisites - 1. Download and install the latest [.NET 7 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux). + 1. Download and install the latest [.NET 8 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux). 1. Using _bash_, install git: ```bash sudo apt update && sudo apt install git diff --git a/global.json b/global.json index 08f229ce0..f6ba4b7d1 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.0", + "version": "8.0.0", "rollForward": "latestMajor", "allowPrerelease": false } diff --git a/version.json b/version.json index 926fabcde..ce75bdf47 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.10.2" + "version": "0.11.1" }