Skip to content

Commit

Permalink
feat: Updates to .NET 8. (#1542)
Browse files Browse the repository at this point in the history
### Breaking Changes
- Updating to .NET 8 - Required O/S's have slightly changed.
  • Loading branch information
kamronbatman authored Nov 15, 2023
1 parent bd79509 commit 2e4668d
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"modernuoschemagenerator": {
"version": "2.7.2",
"version": "2.8.0",
"commands": [
"ModernUOSchemaGenerator"
]
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Authors>Kamron Batman</Authors>
<Company>ModernUO</Company>
<Copyright>2019-2023</Copyright>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<PublicRelease>true</PublicRelease>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NoWarn>NU1603</NoWarn>
Expand Down
5 changes: 4 additions & 1 deletion Projects/Server.Tests/Server.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\Server\Server.csproj" />
<ProjectReference Include="..\UOContent\UOContent.csproj" />
<DataFiles Include="$(SolutionDir)\Distribution\Data\**" />
Expand Down
2 changes: 1 addition & 1 deletion Projects/Server/Buffers/SpanWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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;
Expand Down
6 changes: 3 additions & 3 deletions Projects/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Delete Files="..\..\Distribution\$(AssemblyName).runtimeconfig.dev.json" ContinueOnError="true" />
<Delete Files="..\..\Distribution\$(AssemblyName).runtimeconfig.json" ContinueOnError="true" />
<Delete Files="..\..\Distribution\ModernUO.Serialization.Annotations.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Microsoft.Toolkit.HighPerformance.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\CommunityToolkit.HighPerformance.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\PollGroup.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\ref\$(AssemblyName).dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Serilog.dll" ContinueOnError="true" />
Expand All @@ -32,12 +32,12 @@
<Delete Files="..\..\Distribution\ZLib.Bindings.dll" ContinueOnError="true" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.2" />
<PackageReference Include="PollGroup" Version="1.4.3" />
<PackageReference Include="Standart.Hash.xxHash.Signed" Version="4.0.5" />
<PackageReference Include="Zlib.Bindings" Version="1.11.0" />

<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.6.0" />
<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.8.0" />
<PackageReference Include="ModernUO.Serialization.Generator" Version="2.7.2" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Projects/Server/Text/OrdinalStringHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static bool EqualsOrdinal(this string a, string b) =>

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool StartsWithOrdinal(this ReadOnlySpan<char> a, char b) =>
a.StartsWithOrdinal(new ReadOnlySpan<char>(b));
a.StartsWithOrdinal(new ReadOnlySpan<char>(ref b));

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool StartsWithOrdinal(this ReadOnlySpan<char> a, ReadOnlySpan<char> b) =>
Expand All @@ -52,7 +52,7 @@ public static bool EndsWithOrdinal(this string a, string b) =>
a?.EndsWith(b, StringComparison.Ordinal) == true;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool EndsWithOrdinal(this ReadOnlySpan<char> a, char b) => a.EndsWithOrdinal(new ReadOnlySpan<char>(b));
public static bool EndsWithOrdinal(this ReadOnlySpan<char> a, char b) => a.EndsWithOrdinal(new ReadOnlySpan<char>(ref b));

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool EndsWithOrdinal(this ReadOnlySpan<char> a, ReadOnlySpan<char> b) =>
Expand Down Expand Up @@ -86,7 +86,7 @@ public static int IndexOfOrdinal(this string a, string b, int startIndex) =>

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int IndexOfOrdinal(this ReadOnlySpan<char> a, char b) =>
a.IndexOfOrdinal(new ReadOnlySpan<char>(b));
a.IndexOfOrdinal(new ReadOnlySpan<char>(ref b));

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int IndexOfOrdinal(this ReadOnlySpan<char> a, ReadOnlySpan<char> b) =>
Expand Down
1 change: 0 additions & 1 deletion Projects/Server/Utilities/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml;
using Microsoft.Toolkit.HighPerformance;
using Server.Buffers;
using Server.Collections;
using Server.Logging;
Expand Down
5 changes: 4 additions & 1 deletion Projects/UOContent.Tests/UOContent.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\Server\Server.csproj" />
<ProjectReference Include="..\Server.Tests\Server.Tests.csproj" />
<ProjectReference Include="..\UOContent\UOContent.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Accounting/Firewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.IO;
using System.Net;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.HighPerformance;
using CommunityToolkit.HighPerformance;

namespace Server
{
Expand Down
5 changes: 3 additions & 2 deletions Projects/UOContent/Commands/Object Creation/Decorate.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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;
using Server.Engines.Spawners;
using Server.Items;
using Server.Network;
using Server.Utilities;
using MemoryExtensions = System.MemoryExtensions;

namespace Server.Commands
{
Expand Down Expand Up @@ -1266,7 +1267,7 @@ public static DecorationList Read(StreamReader ip)
}
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(';'))
Expand Down
5 changes: 3 additions & 2 deletions Projects/UOContent/Commands/Object Creation/DecorateMag.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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;
using Server.Engines.Spawners;
using Server.Items;
using Server.Network;
using Server.Utilities;
using MemoryExtensions = System.MemoryExtensions;

namespace Server.Commands
{
Expand Down Expand Up @@ -1252,7 +1253,7 @@ public static DecorationListMag Read(StreamReader ip)
}
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(';'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Special Systems/Engines/TestCenter.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
7 changes: 4 additions & 3 deletions Projects/UOContent/UOContent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Delete Files="..\..\Distribution\Assemblies\MailKit.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\MimeKit.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\Microsoft.Toolkit.HighPerformance.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\CommunityToolkit.HighPerformance.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\Microsoft.Extensions.FileSystemGlobbing.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\Serilog.dll" ContinueOnError="true" />
<Delete Files="..\..\Distribution\Assemblies\Serilog.Sinks.Async.dll" ContinueOnError="true" />
Expand All @@ -32,13 +33,13 @@
<IncludeInPackage>false</IncludeInPackage>
</ProjectReference>
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="7.0.0" />
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.2" />
<PackageReference Include="Zlib.Bindings" Version="1.11.0" />
<PackageReference Include="Argon2.Bindings" Version="1.16.1" />
<PackageReference Include="Zstd.Binaries" Version="1.6.0" />

<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.6.0" />
<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.8.0" />
<PackageReference Include="ModernUO.Serialization.Generator" Version="2.7.2" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/World Saves/AutoArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using Microsoft.Toolkit.HighPerformance;
using CommunityToolkit.HighPerformance;
using Server.Compression;
using Server.Logging;

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<br />
[![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/)
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"version": "8.0.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 2e4668d

Please sign in to comment.