Skip to content

Commit a11b96c

Browse files
committed
Updated JetBrains.Resharper.GlobalTools and fixed issued in code styoe commands.
1 parent d703e82 commit a11b96c

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/PostSharp.Engineering.BuildTools/CodeStyle/BaseCodeStyleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal abstract class BaseCodeStyleCommand<T> : BaseCommand<T>
1414
{
1515
protected static string? GetCodeStyleRepo( BuildContext context, CodeStyleSettings settings )
1616
{
17-
var sharedRepo = Path.GetFullPath( Path.Combine( context.RepoDirectory, "..", "PostSharp.Engineering.CodeStyle" ) );
17+
var sharedRepo = Path.GetFullPath( Path.Combine( context.RepoDirectory, settings.Path ?? "../PostSharp.Engineering.CodeStyle" ) );
1818
var console = context.Console;
1919

2020
// Check if the repo exists.

src/PostSharp.Engineering.BuildTools/CodeStyle/CodeStyleSettings.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ internal class CodeStyleSettings : CommonCommandSettings
1616
[CommandOption( "--create" )]
1717
public bool Create { get; init; }
1818

19+
[Description( "Path to PostSharp.Engineering.CodeStyle. The default value is `../PostSharp.Engineering.CodeStyle`." )]
20+
[CommandArgument( 0, "[path]" )]
21+
public string Path { get; init; } = "../PostSharp.Engineering.CodeStyle";
22+
1923
[Description( "Remote URL of the repo." )]
2024
[CommandOption( "-u|--url" )]
2125
public string Url { get; init; } =
2226
"https://github.com/postsharp/PostSharp.Engineering.CodeStyle.git";
23-
}
27+
}

src/PostSharp.Engineering.BuildTools/CodeStyle/ResharperCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected override bool ExecuteCore( BuildContext context, CommonCommandSettings
4343
context.Console,
4444
"dotnet",
4545
"--version",
46-
Path.GetDirectoryName( formattableSolution.SolutionPath ),
46+
Path.Combine( context.RepoDirectory, Path.GetDirectoryName( formattableSolution.SolutionPath )! ),
4747
out _,
4848
out var sdkVersionString,
4949
ToolInvocationOptions.Default with { Silent = true } );

src/PostSharp.Engineering.BuildTools/Utilities/DotNetTool.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
22

33
using JetBrains.Annotations;
4+
using NuGet.Versioning;
45
using PostSharp.Engineering.BuildTools.Build;
56
using System;
67
using System.Collections.Immutable;
@@ -21,7 +22,7 @@ public class DotNetTool
2122

2223
public static DotNetTool SignClient { get; } = new SignTool();
2324

24-
public static DotNetTool Resharper { get; } = new( "jb", "JetBrains.Resharper.GlobalTools", "2024.3.0", "jb" );
25+
public static DotNetTool Resharper { get; } = new( "jb", "JetBrains.Resharper.GlobalTools", "2025.2.0", "jb" );
2526

2627
public static ImmutableArray<DotNetTool> DefaultTools { get; } = [SignClient, Resharper];
2728

@@ -69,9 +70,9 @@ public bool Install( BuildContext context )
6970
}
7071
else
7172
{
72-
var installedVersion = System.Version.Parse( installedVersionString );
73+
var installedVersion = NuGetVersion.Parse( installedVersionString );
7374

74-
if ( installedVersion < System.Version.Parse( this.Version ) )
75+
if ( installedVersion < NuGetVersion.Parse( this.Version ) )
7576
{
7677
installVerb = "update";
7778
}

0 commit comments

Comments
 (0)