Skip to content

Commit

Permalink
Update to .NET 8.0, and performance fixes (#81)
Browse files Browse the repository at this point in the history
* Update to .NET 8.0

* Change Immutable collection usages to Frozen collections where possible

* Change frozen collections to immutable where not long standing

* Remove unused using imports

* Add property to restore packages with packages.lock.json

* Add freezing mechanism to template managers and loaders to call Freeze()

* Change ToImmutableHashSet calls to ToImmutableArray when used for iteration

* Add template manager freezing to NPC string and Mob string

* Update build workflow to allow preview dotnet builds

* Optimise encryption, avoid creating multiple transformer per transform

* Fix redundant tmp variable

* Update packages.lock.json

* Update collections to use immutable

* Update workflows to use .NET 8

* Oops missed out on some configs
  • Loading branch information
Kaioru authored Nov 15, 2023
1 parent 5ae5116 commit c435e31
Show file tree
Hide file tree
Showing 134 changed files with 4,169 additions and 203 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- name: Install Minver
run: dotnet tool install --global minver-cli --version 4.3.0
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- uses: actions/cache@v1
with:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- uses: actions/cache@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
!**/appsettings.json
!**/devsettings.json

!**/packages.lock.json

.env
scripts.zip
data.zip
Expand Down
17 changes: 5 additions & 12 deletions src/Source.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<PropertyGroup>
<Authors>Kaioru</Authors>

Expand All @@ -27,16 +31,5 @@
<None Include="../../../README.md" Pack="true" PackagePath="/"/>
<None Include="../../../LICENSE" Pack="true" PackagePath="/"/>
</ItemGroup>

<PropertyGroup>
<MinVerDefaultPreReleaseIdentifiers>preview</MinVerDefaultPreReleaseIdentifiers>
<MinVerMinimumMajorMinor>1.0</MinVerMinimumMajorMinor>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Immutable;
using System.Collections.Frozen;
using System.Diagnostics;
using Edelstein.Common.Utilities.Templates;
using Microsoft.Extensions.Logging;
Expand All @@ -16,7 +16,7 @@ IEnumerable<ITemplateLoader> loaders
)
{
_logger = logger;
_loaders = loaders.ToImmutableList();
_loaders = loaders.ToFrozenSet();
}

public int Priority => BootstrapPriority.Load;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Duey.Provider.WZ" Version="2.0.0" />
<PackageReference Include="Foundatio.JsonNet" Version="10.6.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
Expand Down
Loading

0 comments on commit c435e31

Please sign in to comment.