From 6817803f8765629bc84e263918f38a267ac6dbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dembski?= Date: Tue, 14 Nov 2023 21:27:54 +0100 Subject: [PATCH] Updating to .Net 8.0 --- .config/dotnet-tools.json | 6 ++++++ .github/workflows/CI.yml | 6 +++--- DemoEngine.sln | 1 + build/Build.cs | 21 ++++++++++++------- build/_build.csproj | 4 +++- global.json | 2 +- src/Demo.Engine.Core/Demo.Engine.Core.csproj | 8 +++---- .../Demo.Engine.Platform.DirectX.csproj | 2 +- .../Demo.Engine.Platform.Windows.csproj | 2 +- src/Demo.Engine/Demo.Engine.csproj | 2 +- .../Demo.Tools.Common.csproj | 6 +++--- .../Demo.Engine.Core.UTs.csproj | 4 ++-- .../Demo.Tools.Common.UTs.csproj | 4 ++-- 13 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b5c92636..bd30dc75 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -7,6 +7,12 @@ "commands": [ "nuke" ] + }, + "coveralls.net": { + "version": "4.0.1", + "commands": [ + "csmacnz.Coveralls" + ] } } } \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0f276a7f..d3ed5379 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,8 +49,8 @@ jobs: with: name: Demo.Engine.zip path: artifacts/Demo.Engine.zip - - name: 'Publish: Demo.Engine.win10-x64.zip' + - name: 'Publish: Demo.Engine.win-x64.zip' uses: actions/upload-artifact@v3 with: - name: Demo.Engine.win10-x64.zip - path: artifacts/Demo.Engine.win10-x64.zip + name: Demo.Engine.win-x64.zip + path: artifacts/Demo.Engine.win-x64.zip diff --git a/DemoEngine.sln b/DemoEngine.sln index 120aa55c..b81e4d0f 100644 --- a/DemoEngine.sln +++ b/DemoEngine.sln @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig Directory.Build.props = Directory.Build.props + .config\dotnet-tools.json = .config\dotnet-tools.json global.json = global.json EndProjectSection EndProject diff --git a/build/Build.cs b/build/Build.cs index 29bdfa36..6b4b6bbd 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -34,10 +34,10 @@ namespace BuildScript; [GitHubActions( "CI", GitHubActionsImage.WindowsLatest, - On = new[] - { + On = + [ GitHubActionsTrigger.Push - }, + ], InvokedTargets = new[] { nameof(Clean), @@ -79,7 +79,7 @@ internal partial class Build : NukeBuild public readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; [Parameter("Self contained application rids")] - public readonly string[] RIDs = Array.Empty(); + public readonly string[] RIDs = []; [Parameter("Coveralls token")] public readonly string? CoverallsToken = null; @@ -125,7 +125,7 @@ protected override void OnBuildInitialized() .SetNoFetch(false) .SetNoCache(true) .SetVerbosity(GitVersionVerbosity.debug) - .SetFramework("net7.0") + .SetFramework("net8.0") .DisableProcessLogOutput()) .Result; } @@ -152,10 +152,14 @@ protected override void OnBuildInitialized() .Executes(() => DotNetRestore(_ => _ .SetProjectFile(Solution))); +#pragma warning disable CA1822 // Mark members as static + public Target VerifyCodeFormat => _ => _ .Executes(() => DotNet( @"format -v n --verify-no-changes --exclude .\src\Demo.Engine\Program.cs")); +#pragma warning restore CA1822 // Mark members as static + public Target Compile => _ => _ .DependsOn(Restore, VerifyCodeFormat) .Executes(() => DotNetBuild(_ => _ @@ -221,15 +225,15 @@ protected override void OnBuildInitialized() .After(Test) .Produces( ArtifactsDirectory / "Demo.Engine.zip", - ArtifactsDirectory / "Demo.Engine.win10-x64.zip") + ArtifactsDirectory / "Demo.Engine.win-x64.zip") .Executes(() => { //A runtime dependant version is also currently generated by default and exposed to CI artifacts PublishApp("Demo.Engine"); - //We generate a self contained, "one file", trimmed version for Windows 10 x64 by default + //We generate a self contained, "one file", trimmed version for Windows x64 by default //Any other can be generated as well, but aren't currently supported so aren't exposed to CI artifacts - foreach (var rid in RIDs.Concat("win10-x64")) + foreach (var rid in RIDs.Concat("win-x64")) { PublishApp("Demo.Engine", rid); } @@ -258,6 +262,7 @@ protected override void OnBuildInitialized() .ToArray()[3..] .Select(o => o.Text)) .Trim(); + Environment.SetEnvironmentVariable("DOTNET_ROLL_FORWARD", "LatestMajor"); _ = CoverallsNet(toolSettings => toolSettings .SetDryRun(Debugger.IsAttached) diff --git a/build/_build.csproj b/build/_build.csproj index c4ce081d..657f7cb8 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 false False @@ -11,6 +11,8 @@ .. 1 enable + + true diff --git a/global.json b/global.json index 1c7274b7..501e79a8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/src/Demo.Engine.Core/Demo.Engine.Core.csproj b/src/Demo.Engine.Core/Demo.Engine.Core.csproj index 7ece51cf..22dba8b5 100644 --- a/src/Demo.Engine.Core/Demo.Engine.Core.csproj +++ b/src/Demo.Engine.Core/Demo.Engine.Core.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 x64 enable @@ -15,9 +15,9 @@ - - - + + + diff --git a/src/Demo.Engine.Platform.DirectX/Demo.Engine.Platform.DirectX.csproj b/src/Demo.Engine.Platform.DirectX/Demo.Engine.Platform.DirectX.csproj index c87d31a6..9abed793 100644 --- a/src/Demo.Engine.Platform.DirectX/Demo.Engine.Platform.DirectX.csproj +++ b/src/Demo.Engine.Platform.DirectX/Demo.Engine.Platform.DirectX.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 true x64 enable diff --git a/src/Demo.Engine.Platform.Windows/Demo.Engine.Platform.Windows.csproj b/src/Demo.Engine.Platform.Windows/Demo.Engine.Platform.Windows.csproj index 7ed6563f..0d348d84 100644 --- a/src/Demo.Engine.Platform.Windows/Demo.Engine.Platform.Windows.csproj +++ b/src/Demo.Engine.Platform.Windows/Demo.Engine.Platform.Windows.csproj @@ -2,7 +2,7 @@ - net7.0-windows + net8.0-windows true x64 enable diff --git a/src/Demo.Engine/Demo.Engine.csproj b/src/Demo.Engine/Demo.Engine.csproj index 6f608dd4..0f0ea40e 100644 --- a/src/Demo.Engine/Demo.Engine.csproj +++ b/src/Demo.Engine/Demo.Engine.csproj @@ -2,7 +2,7 @@ Exe - net7.0-windows + net8.0-windows true x64 enable diff --git a/src/Demo.Tools.Common/Demo.Tools.Common.csproj b/src/Demo.Tools.Common/Demo.Tools.Common.csproj index af70b06f..ae6890f5 100644 --- a/src/Demo.Tools.Common/Demo.Tools.Common.csproj +++ b/src/Demo.Tools.Common/Demo.Tools.Common.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 x64 enable @@ -15,8 +15,8 @@ - - + + diff --git a/test/Demo.Engine.Core.UTs/Demo.Engine.Core.UTs.csproj b/test/Demo.Engine.Core.UTs/Demo.Engine.Core.UTs.csproj index 0e0d626c..99a21d15 100644 --- a/test/Demo.Engine.Core.UTs/Demo.Engine.Core.UTs.csproj +++ b/test/Demo.Engine.Core.UTs/Demo.Engine.Core.UTs.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false x64 enable @@ -21,7 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/test/Demo.Tools.Common.UTs/Demo.Tools.Common.UTs.csproj b/test/Demo.Tools.Common.UTs/Demo.Tools.Common.UTs.csproj index 142c0634..81b618ff 100644 --- a/test/Demo.Tools.Common.UTs/Demo.Tools.Common.UTs.csproj +++ b/test/Demo.Tools.Common.UTs/Demo.Tools.Common.UTs.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false x64 enable @@ -21,7 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all