From f670d62ecc8b6a0833d3717d4fc3bad42739efcd Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 29 Dec 2024 16:31:06 +0100 Subject: [PATCH 1/9] update --- .github/workflows/build.yml | 3 +++ .../CommandLine.DocumentationGenerator.csproj | 4 ++-- src/CommandLine/CommandLine.csproj | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd2d8b3dc9..8b217ed96c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -261,6 +261,9 @@ jobs: working-directory: src/CommandLine steps: - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.101' - run: dotnet restore - run: dotnet build --no-restore - run: dotnet pack --no-build diff --git a/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj b/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj index 8cf58f8bf1..d1b68e2023 100644 --- a/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj +++ b/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj @@ -1,11 +1,11 @@  - net8.0 + net9.0 - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 diff --git a/src/CommandLine/CommandLine.csproj b/src/CommandLine/CommandLine.csproj index de80181f19..195a08a167 100644 --- a/src/CommandLine/CommandLine.csproj +++ b/src/CommandLine/CommandLine.csproj @@ -1,11 +1,11 @@  - net8.0 + net9.0 - net7.0;net8.0 + net7.0;net8.0;net9.0 From 0dcae86439b2d17c9eb0c2a68d99cc8555b64bd6 Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 29 Dec 2024 16:37:07 +0100 Subject: [PATCH 2/9] update --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b217ed96c..2c8a300d18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ env: WarningsNotAsErrors: 1573,1591,NU5128 Deterministic: true RunCodeAnalysis: false + Net9Version: 9.0.101 jobs: pre_build: @@ -28,6 +29,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.Net9Version }} - run: dotnet tool install -g GitVersion.Tool --version 5.11.1 - name: Resolve version id: version @@ -263,7 +267,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.0.101' + dotnet-version: ${{ env.Net9Version }} - run: dotnet restore - run: dotnet build --no-restore - run: dotnet pack --no-build From 90d223c342793d3f0ae36d4b2f9fb2748b4ead1a Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 29 Dec 2024 16:50:22 +0100 Subject: [PATCH 3/9] fixes --- src/CommandLine/DelegateFactory.cs | 2 +- src/Documentation/SymbolDefinitionDisplay.cs | 2 +- .../SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs | 2 +- src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CommandLine/DelegateFactory.cs b/src/CommandLine/DelegateFactory.cs index f21f5a86a3..fd36904ca0 100644 --- a/src/CommandLine/DelegateFactory.cs +++ b/src/CommandLine/DelegateFactory.cs @@ -150,7 +150,7 @@ private static TDelegate CreateDelegate( if (method.IsStatic) { - return (TDelegate)method.CreateDelegate(typeof(TDelegate)); + return method.CreateDelegate(); } else { diff --git a/src/Documentation/SymbolDefinitionDisplay.cs b/src/Documentation/SymbolDefinitionDisplay.cs index ab586ef1e8..1e7411f759 100644 --- a/src/Documentation/SymbolDefinitionDisplay.cs +++ b/src/Documentation/SymbolDefinitionDisplay.cs @@ -955,7 +955,7 @@ private static void FormatParameters( private static int FindParameterListStart( ISymbol symbol, - IList parts) + ImmutableArray.Builder parts) { int parenthesesDepth = 0; int bracesDepth = 0; diff --git a/src/Refactorings/CSharp/Refactorings/SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs b/src/Refactorings/CSharp/Refactorings/SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs index 6a34cb20ef..62d301f652 100644 --- a/src/Refactorings/CSharp/Refactorings/SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs +++ b/src/Refactorings/CSharp/Refactorings/SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs @@ -109,7 +109,7 @@ private static Task RefactorAsync( return document.ReplaceMembersAsync(info, newMembers, cancellationToken); } - private static SyntaxKind GetSingleKindOrDefault(IReadOnlyList members) + private static SyntaxKind GetSingleKindOrDefault(MemberDeclarationListSelection members) { SyntaxKind kind = members[0].Kind(); diff --git a/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs b/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs index 499ba4a85e..4cf346d3ef 100644 --- a/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs +++ b/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs @@ -158,7 +158,7 @@ public static string CreateAnalyzerMarkdown(AnalyzerMetadata analyzer, Immutable static IEnumerable CreateSamples(AnalyzerMetadata analyzer) { - IReadOnlyList samples = analyzer.Samples; + List samples = analyzer.Samples; LegacyAnalyzerOptionKind kind = analyzer.Kind; if (samples.Count > 0) From f96725abd65a61a7d444c351248888e2ac37c85e Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 29 Dec 2024 17:26:23 +0100 Subject: [PATCH 4/9] fix --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c8a300d18..67810a2bea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,14 +65,14 @@ jobs: repository: josefpihrt/wordb path: wordb - run: dotnet tool install -g Roslynator.DotNet.Cli --version 0.8.3 - - run: | - roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ - spellcheck \ - ../wordb/data/en \ - ../wordb/data/en-us \ - ../wordb/data/names.txt \ - ../wordb/data/tech.names.txt \ - ../wordb/data/tech.acronyms.txt +# - run: | +# roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ +# spellcheck \ +# ../wordb/data/en \ +# ../wordb/data/en-us \ +# ../wordb/data/names.txt \ +# ../wordb/data/tech.names.txt \ +# ../wordb/data/tech.acronyms.txt build_core_and_testing: if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') From b4b93de0c0e88eedc877d499ce6ec484c9560249 Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 29 Dec 2024 17:57:32 +0100 Subject: [PATCH 5/9] fix --- src/CommandLine/DelegateFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CommandLine/DelegateFactory.cs b/src/CommandLine/DelegateFactory.cs index fd36904ca0..df75f0741a 100644 --- a/src/CommandLine/DelegateFactory.cs +++ b/src/CommandLine/DelegateFactory.cs @@ -150,7 +150,11 @@ private static TDelegate CreateDelegate( if (method.IsStatic) { +#if NETFRAMEWORK + return (TDelegate)method.CreateDelegate(typeof(TDelegate)); +#else return method.CreateDelegate(); +#endif } else { From 35341650cff5ab592c2da81ed17641e43983777d Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Wed, 1 Jan 2025 10:15:42 +0100 Subject: [PATCH 6/9] update --- ChangeLog.md | 4 ++++ .../CommandLine.DocumentationGenerator.csproj | 4 ++-- src/CommandLine/CommandLine.csproj | 2 +- src/CommandLine/docs/NetCore/NuGetReadme.md | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a6cbc447fd..8c7d83a2e7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- [CLI] Add support for .NET 9 ([PR](https://github.com/dotnet/roslynator/pull/1605)) + ### Fixed - Fix refactoring 'Change accessibility' ([RR0186](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0186)) ([PR](https://github.com/dotnet/roslynator/pull/1599)) diff --git a/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj b/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj index d1b68e2023..642d1aecea 100644 --- a/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj +++ b/src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj @@ -1,11 +1,11 @@  - net9.0 + net8.0 - net6.0;net7.0;net8.0;net9.0 + net7.0;net8.0;net9.0 diff --git a/src/CommandLine/CommandLine.csproj b/src/CommandLine/CommandLine.csproj index 195a08a167..cc3354cb0a 100644 --- a/src/CommandLine/CommandLine.csproj +++ b/src/CommandLine/CommandLine.csproj @@ -1,7 +1,7 @@  - net9.0 + net8.0 diff --git a/src/CommandLine/docs/NetCore/NuGetReadme.md b/src/CommandLine/docs/NetCore/NuGetReadme.md index 727601c207..23936670be 100644 --- a/src/CommandLine/docs/NetCore/NuGetReadme.md +++ b/src/CommandLine/docs/NetCore/NuGetReadme.md @@ -4,7 +4,7 @@ ## Requirements -.NET Core SDK 6.0, 7.0 or 8.0. +.NET Core SDK 7, 8 or 9. ## Installation From 2754eaf2bc03c32c8edcf309f4a15a0e54c2e98c Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Wed, 1 Jan 2025 10:19:48 +0100 Subject: [PATCH 7/9] update --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67810a2bea..f84242dc90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,19 +60,19 @@ jobs: - run: | dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info - run: dotnet test Roslynator.sln --no-build - - uses: actions/checkout@v4 - with: - repository: josefpihrt/wordb - path: wordb - - run: dotnet tool install -g Roslynator.DotNet.Cli --version 0.8.3 -# - run: | -# roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ -# spellcheck \ -# ../wordb/data/en \ -# ../wordb/data/en-us \ -# ../wordb/data/names.txt \ -# ../wordb/data/tech.names.txt \ -# ../wordb/data/tech.acronyms.txt + # - uses: actions/checkout@v4 + # with: + # repository: josefpihrt/wordb + # path: wordb + # - run: dotnet tool install -g Roslynator.DotNet.Cli --version 0.8.3 + # - run: | + # roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ + # spellcheck \ + # ../wordb/data/en \ + # ../wordb/data/en-us \ + # ../wordb/data/names.txt \ + # ../wordb/data/tech.names.txt \ + # ../wordb/data/tech.acronyms.txt build_core_and_testing: if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') From a469936cc136504716a72545ff9cf58d06e7e5eb Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Wed, 1 Jan 2025 10:26:05 +0100 Subject: [PATCH 8/9] update --- .github/workflows/build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f84242dc90..9bb5ad345a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ env: WarningsNotAsErrors: 1573,1591,NU5128 Deterministic: true RunCodeAnalysis: false - Net9Version: 9.0.101 jobs: pre_build: @@ -29,9 +28,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.Net9Version }} - run: dotnet tool install -g GitVersion.Tool --version 5.11.1 - name: Resolve version id: version @@ -267,7 +263,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: - dotnet-version: ${{ env.Net9Version }} + dotnet-version: 9.0.101 - run: dotnet restore - run: dotnet build --no-restore - run: dotnet pack --no-build From 3794d380cc591a3236608df976bd4272f18b3fe4 Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Wed, 1 Jan 2025 10:36:21 +0100 Subject: [PATCH 9/9] update --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bb5ad345a..f3c90a08ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,19 +56,19 @@ jobs: - run: | dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info - run: dotnet test Roslynator.sln --no-build - # - uses: actions/checkout@v4 - # with: - # repository: josefpihrt/wordb - # path: wordb - # - run: dotnet tool install -g Roslynator.DotNet.Cli --version 0.8.3 - # - run: | - # roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ - # spellcheck \ - # ../wordb/data/en \ - # ../wordb/data/en-us \ - # ../wordb/data/names.txt \ - # ../wordb/data/tech.names.txt \ - # ../wordb/data/tech.acronyms.txt + - uses: actions/checkout@v4 + with: + repository: josefpihrt/wordb + path: wordb + - run: dotnet tool install -g Roslynator.DotNet.Cli --version 0.8.3 + - run: | + roslynator spellcheck Roslynator.sln --dry-run --scope all --words \ + spellcheck \ + ../wordb/data/en \ + ../wordb/data/en-us \ + ../wordb/data/names.txt \ + ../wordb/data/tech.names.txt \ + ../wordb/data/tech.acronyms.txt build_core_and_testing: if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v')