From ec17091ef6b5d29e779d175523653d0ce37089b0 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Sun, 4 Oct 2026 14:52:25 -0400 Subject: [PATCH 1/4] Upgraded the projects to .net 10 Also bumped the version of xUnit that is being used --- src/Directory.Build.props | 7 ++++++ src/Directory.Packages.props | 1 + .../ConsoleApp.SourceGenerator.Tests.csproj | 21 +++--------------- .../CompiliationTestBase.cs | 4 ++-- .../ExtendedAnalyzerRuleTests.cs | 1 - .../SourceGenerator.Foundations.Tests.csproj | 22 +------------------ .../SourceGeneratorAnalyzerTests.cs | 1 - 7 files changed, 14 insertions(+), 43 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index d66d22e..98c2102 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -38,4 +38,11 @@ + + false + net10.0 + false + true + true + \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 44c8a66..86c0ed7 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -21,5 +21,6 @@ + \ No newline at end of file diff --git a/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj index 4ca0e9d..95fa14a 100644 --- a/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj +++ b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj @@ -1,23 +1,8 @@ - - - net8.0 - enable - enable - 12 - - false - true - - - - - - - - - + + + diff --git a/src/SourceGenerator.Foundations.Tests/CompiliationTestBase.cs b/src/SourceGenerator.Foundations.Tests/CompiliationTestBase.cs index 08d3e89..fb6e795 100644 --- a/src/SourceGenerator.Foundations.Tests/CompiliationTestBase.cs +++ b/src/SourceGenerator.Foundations.Tests/CompiliationTestBase.cs @@ -5,7 +5,7 @@ using System.Collections.Immutable; using System.Reflection; using System.Text; -using Xunit.Abstractions; +using Xunit.Sdk; namespace SGF { @@ -39,7 +39,7 @@ protected CompilationTestBase(ITestOutputHelper outputHelper) ITest? test = testField?.GetValue(outputHelper) as ITest; if (test != null) { - TestMethodName = test.TestCase.TestMethod.ToString()!; + TestMethodName = test.TestCase.TestMethod?.ToString()!; } AddAssemblyReference("System.Runtime"); diff --git a/src/SourceGenerator.Foundations.Tests/ExtendedAnalyzerRuleTests.cs b/src/SourceGenerator.Foundations.Tests/ExtendedAnalyzerRuleTests.cs index c335f30..a739aa0 100644 --- a/src/SourceGenerator.Foundations.Tests/ExtendedAnalyzerRuleTests.cs +++ b/src/SourceGenerator.Foundations.Tests/ExtendedAnalyzerRuleTests.cs @@ -1,6 +1,5 @@ using Microsoft.CodeAnalysis.CSharp.Analyzers; using SGF; -using Xunit.Abstractions; namespace SourceGenerator.Foundations.Tests { diff --git a/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj b/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj index 5e717da..f313bae 100644 --- a/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj +++ b/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj @@ -1,30 +1,9 @@  - - - net6.0 - enable - 12 - enable - - false - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/src/SourceGenerator.Foundations.Tests/SourceGeneratorAnalyzerTests.cs b/src/SourceGenerator.Foundations.Tests/SourceGeneratorAnalyzerTests.cs index d1fc893..5e03a97 100644 --- a/src/SourceGenerator.Foundations.Tests/SourceGeneratorAnalyzerTests.cs +++ b/src/SourceGenerator.Foundations.Tests/SourceGeneratorAnalyzerTests.cs @@ -1,7 +1,6 @@ using SGF; using SGF.Analyzer; using SGF.Analyzer.Rules; -using Xunit.Abstractions; namespace SourceGenerator.Foundations.Tests { From 6feee5725635665f40d72a5ea16b7d58ca7d908d Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Sun, 4 Oct 2026 15:02:36 -0400 Subject: [PATCH 2/4] Continued the upgrade for the xunit tests --- src/Directory.Build.props | 1 + src/Directory.Packages.props | 1 + .../ConsoleApp.SourceGenerator.Tests.csproj | 3 ++- .../SourceGenerator.Foundations.Tests.csproj | 1 + src/SourceGenerator.Foundations.sln | 1 + src/global.json | 9 +++++++++ 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/global.json diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 98c2102..2e002e2 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -44,5 +44,6 @@ false true true + Exe \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 86c0ed7..885d94f 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -14,6 +14,7 @@ + diff --git a/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj index 95fa14a..d692100 100644 --- a/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj +++ b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ConsoleApp.SourceGenerator.Tests.csproj @@ -1,6 +1,7 @@ - + + diff --git a/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj b/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj index f313bae..8dc0611 100644 --- a/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj +++ b/src/SourceGenerator.Foundations.Tests/SourceGenerator.Foundations.Tests.csproj @@ -3,6 +3,7 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 17ac19adea3cd1d4860dcaae9ca3cd29503f1357 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Sun, 4 Oct 2026 15:11:27 -0400 Subject: [PATCH 4/4] Updated the CI .net version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfad5ac..ec67001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 10.0.x - name: Build Solution run: dotnet test src\SourceGenerator.Foundations.sln @@ -40,7 +40,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 10.0.x - name: Test | ${{ matrix.project.name }} run: dotnet test src\${{ matrix.project.path }}${{ matrix.project.name }}\${{ matrix.project.name }}.csproj @@ -65,7 +65,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 10.0.x - name: Restore run: dotnet tool restore - name: GitVersion