Skip to content

Commit

Permalink
[CLI] Support .NET 9 (#1605)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored Jan 1, 2025
1 parent f214e3e commit 8c591b3
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorDotNetCli)' == true">
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorCommandLine)' == true">
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorDotNetCli)' == true">
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorCommandLine)' == true">
Expand Down
4 changes: 4 additions & 0 deletions src/CommandLine/DelegateFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ private static TDelegate CreateDelegate<TDelegate>(

if (method.IsStatic)
{
#if NETFRAMEWORK
return (TDelegate)method.CreateDelegate(typeof(TDelegate));
#else
return method.CreateDelegate<TDelegate>();
#endif
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/docs/NetCore/NuGetReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Requirements

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

## Installation

Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/SymbolDefinitionDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ private static void FormatParameters(

private static int FindParameterListStart(
ISymbol symbol,
IList<SymbolDisplayPart> parts)
ImmutableArray<SymbolDisplayPart>.Builder parts)
{
int parenthesesDepth = 0;
int bracesDepth = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static Task<Document> RefactorAsync(
return document.ReplaceMembersAsync(info, newMembers, cancellationToken);
}

private static SyntaxKind GetSingleKindOrDefault(IReadOnlyList<MemberDeclarationSyntax> members)
private static SyntaxKind GetSingleKindOrDefault(MemberDeclarationListSelection members)
{
SyntaxKind kind = members[0].Kind();

Expand Down
2 changes: 1 addition & 1 deletion src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static string CreateAnalyzerMarkdown(AnalyzerMetadata analyzer, Immutable

static IEnumerable<MElement> CreateSamples(AnalyzerMetadata analyzer)
{
IReadOnlyList<SampleMetadata> samples = analyzer.Samples;
List<SampleMetadata> samples = analyzer.Samples;
LegacyAnalyzerOptionKind kind = analyzer.Kind;

if (samples.Count > 0)
Expand Down

0 comments on commit 8c591b3

Please sign in to comment.