From 433453eea040db208dd63ebdc98c4001f172ba8b Mon Sep 17 00:00:00 2001 From: ellizio Date: Tue, 3 Mar 2026 13:59:17 +0300 Subject: [PATCH] Bump Backend to .NET 10 --- .../prepare-build-environment/action.yml | 2 +- src/dotnet/Directory.Build.props | 2 +- .../TestEnvironment.cs | 17 ++++++++--------- .../IODataCliUiZone.cs | 11 ++++------- .../ReSharperPlugin.ODataCliUi/PluginHost.cs | 14 +++++--------- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/prepare-build-environment/action.yml b/.github/workflows/prepare-build-environment/action.yml index 3078dd3..605c3af 100644 --- a/.github/workflows/prepare-build-environment/action.yml +++ b/.github/workflows/prepare-build-environment/action.yml @@ -19,5 +19,5 @@ runs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '10.0.x' dotnet-quality: 'ga' \ No newline at end of file diff --git a/src/dotnet/Directory.Build.props b/src/dotnet/Directory.Build.props index 828a440..3542615 100644 --- a/src/dotnet/Directory.Build.props +++ b/src/dotnet/Directory.Build.props @@ -1,7 +1,7 @@ - net8.0 + net10.0 Latest MSB3277 true diff --git a/src/dotnet/ReSharperPlugin.ODataCliUi.Tests/TestEnvironment.cs b/src/dotnet/ReSharperPlugin.ODataCliUi.Tests/TestEnvironment.cs index 485919d..601e739 100644 --- a/src/dotnet/ReSharperPlugin.ODataCliUi.Tests/TestEnvironment.cs +++ b/src/dotnet/ReSharperPlugin.ODataCliUi.Tests/TestEnvironment.cs @@ -9,14 +9,13 @@ [assembly: Apartment(ApartmentState.STA)] -namespace ReSharperPlugin.ODataCliUi.Tests -{ - [ZoneDefinition] - public class ODataCliUiTestEnvironmentZone : ITestsEnvZone, IRequire, IRequire { } +namespace ReSharperPlugin.ODataCliUi.Tests; - [ZoneMarker] - public class ZoneMarker : IRequire, IRequire, IRequire { } +[ZoneDefinition] +public class ODataCliUiTestEnvironmentZone : ITestsEnvZone, IRequire, IRequire; - [SetUpFixture] - public class ODataCliUiTestsAssembly : ExtensionTestEnvironmentAssembly { } -} +[ZoneMarker] +public class ZoneMarker : IRequire, IRequire, IRequire; + +[SetUpFixture] +public class ODataCliUiTestsAssembly : ExtensionTestEnvironmentAssembly; \ No newline at end of file diff --git a/src/dotnet/ReSharperPlugin.ODataCliUi/IODataCliUiZone.cs b/src/dotnet/ReSharperPlugin.ODataCliUi/IODataCliUiZone.cs index 104057d..4c1eb4e 100644 --- a/src/dotnet/ReSharperPlugin.ODataCliUi/IODataCliUiZone.cs +++ b/src/dotnet/ReSharperPlugin.ODataCliUi/IODataCliUiZone.cs @@ -2,10 +2,7 @@ using JetBrains.ProjectModel; using JetBrains.ProjectModel.NuGet; -namespace ReSharperPlugin.ODataCliUi -{ - [ZoneDefinition] - public interface IODataCliUiZone : IZone, - IRequire, - IRequire; -} +namespace ReSharperPlugin.ODataCliUi; + +[ZoneDefinition] +public interface IODataCliUiZone : IZone, IRequire, IRequire; \ No newline at end of file diff --git a/src/dotnet/ReSharperPlugin.ODataCliUi/PluginHost.cs b/src/dotnet/ReSharperPlugin.ODataCliUi/PluginHost.cs index 3457de9..dbf936d 100644 --- a/src/dotnet/ReSharperPlugin.ODataCliUi/PluginHost.cs +++ b/src/dotnet/ReSharperPlugin.ODataCliUi/PluginHost.cs @@ -32,7 +32,9 @@ public PluginHost(ISolution solution, DotnetToolsTracker dotnetToolsTracker) dotnetToolsTracker.DotnetToolsCacheChanged += OnDotnetToolsCacheChanged; dotnetToolsTracker.Start(); } - + + private DotnetToolDefinition GetODataCliTool(Lifetime lifetime, Unit unit) => _odataCliTool; + private Task AddEmbeddedResourceAsync(Lifetime lifetime, EmbeddedResourceDefinition definition) { IProject project; @@ -41,15 +43,13 @@ private Task AddEmbeddedResourceAsync(Lifetime lifetime, EmbeddedResourceDefinit if (project is null) return Task.CompletedTask; - + var modifier = new ProjectModifier(project); modifier.AddEmbeddedResource(definition.Include); return Task.CompletedTask; } - private DotnetToolDefinition GetODataCliTool(Lifetime lifetime, Unit unit) => _odataCliTool; - private void OnDotnetToolsCacheChanged(DotNetToolCache cache) { var tool = cache.ToolGlobalCache.GetGlobalTool(Constants.MicrosoftODataCliPackageId)?.FirstOrDefault(); @@ -58,9 +58,5 @@ private void OnDotnetToolsCacheChanged(DotNetToolCache cache) : new DotnetToolDefinition(true, new DotnetToolVersionDefinition(tool.Version.Major, tool.Version.Minor, tool.Version.Patch)); } - public void Dispose() - { - if (_dotnetToolsTracker is not null) - _dotnetToolsTracker.DotnetToolsCacheChanged -= OnDotnetToolsCacheChanged; - } + public void Dispose() => _dotnetToolsTracker?.DotnetToolsCacheChanged -= OnDotnetToolsCacheChanged; } \ No newline at end of file