Skip to content

Commit 8c591b3

Browse files
authored
[CLI] Support .NET 9 (#1605)
1 parent f214e3e commit 8c591b3

File tree

9 files changed

+17
-6
lines changed

9 files changed

+17
-6
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ jobs:
261261
working-directory: src/CommandLine
262262
steps:
263263
- uses: actions/checkout@v4
264+
- uses: actions/setup-dotnet@v4
265+
with:
266+
dotnet-version: 9.0.101
264267
- run: dotnet restore
265268
- run: dotnet build --no-restore
266269
- run: dotnet pack --no-build

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- [CLI] Add support for .NET 9 ([PR](https://github.com/dotnet/roslynator/pull/1605))
13+
1014
### Fixed
1115

1216
- Fix refactoring 'Change accessibility' ([RR0186](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0186)) ([PR](https://github.com/dotnet/roslynator/pull/1599))

src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<PropertyGroup Condition="'$(RoslynatorDotNetCli)' == true">
8-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
8+
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="'$(RoslynatorCommandLine)' == true">

src/CommandLine/CommandLine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<PropertyGroup Condition="'$(RoslynatorDotNetCli)' == true">
8-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
8+
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="'$(RoslynatorCommandLine)' == true">

src/CommandLine/DelegateFactory.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ private static TDelegate CreateDelegate<TDelegate>(
150150

151151
if (method.IsStatic)
152152
{
153+
#if NETFRAMEWORK
153154
return (TDelegate)method.CreateDelegate(typeof(TDelegate));
155+
#else
156+
return method.CreateDelegate<TDelegate>();
157+
#endif
154158
}
155159
else
156160
{

src/CommandLine/docs/NetCore/NuGetReadme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Requirements
66

7-
.NET Core SDK 6.0, 7.0 or 8.0.
7+
.NET Core SDK 7, 8 or 9.
88

99
## Installation
1010

src/Documentation/SymbolDefinitionDisplay.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ private static void FormatParameters(
955955

956956
private static int FindParameterListStart(
957957
ISymbol symbol,
958-
IList<SymbolDisplayPart> parts)
958+
ImmutableArray<SymbolDisplayPart>.Builder parts)
959959
{
960960
int parenthesesDepth = 0;
961961
int bracesDepth = 0;

src/Refactorings/CSharp/Refactorings/SortMemberDeclarations/SortMemberDeclarationsRefactoring.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private static Task<Document> RefactorAsync(
109109
return document.ReplaceMembersAsync(info, newMembers, cancellationToken);
110110
}
111111

112-
private static SyntaxKind GetSingleKindOrDefault(IReadOnlyList<MemberDeclarationSyntax> members)
112+
private static SyntaxKind GetSingleKindOrDefault(MemberDeclarationListSelection members)
113113
{
114114
SyntaxKind kind = members[0].Kind();
115115

src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static string CreateAnalyzerMarkdown(AnalyzerMetadata analyzer, Immutable
158158

159159
static IEnumerable<MElement> CreateSamples(AnalyzerMetadata analyzer)
160160
{
161-
IReadOnlyList<SampleMetadata> samples = analyzer.Samples;
161+
List<SampleMetadata> samples = analyzer.Samples;
162162
LegacyAnalyzerOptionKind kind = analyzer.Kind;
163163

164164
if (samples.Count > 0)

0 commit comments

Comments
 (0)