Skip to content

Commit 1f0deaa

Browse files
committed
Update Resharper command settings and improve path handling in build scripts
1 parent 70e436a commit 1f0deaa

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

Build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ if (-not $Interactive -or $BuildArgs)
4040
# Change the working directory so we can use a global.json that is specific to eng.
4141
$previousLocation = Get-Location
4242

43-
Set-Location $PSScriptRoot\$EngPath\src
43+
Set-Location (Join-Path $PSScriptRoot $EngPath "src")
4444

4545
try
4646
{
4747

4848
# Run the project.
49-
& dotnet run --project "$PSScriptRoot\$EngPath\src\Build$ProductName.csproj" -- $BuildArgs
49+
& dotnet run --project (Join-Path $PSScriptRoot $EngPath "src" "Build$ProductName.csproj") -- $BuildArgs
5050

5151
if ($StartVsmon)
5252
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected override string GetCommand( BuildContext context, Solution solution )
2626
return command;
2727
}
2828

29-
protected override bool ExecuteCore( BuildContext context, CommonCommandSettings settings )
29+
protected override bool ExecuteCore( BuildContext context, ResharperCommandSettings settings )
3030
{
3131
if ( !GitHelper.CheckNoChange( context, settings, context.RepoDirectory ) )
3232
{

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
namespace PostSharp.Engineering.BuildTools.CodeStyle;
1010

11-
internal abstract class ResharperCommand : BaseCommand<CommonCommandSettings>
11+
internal abstract class ResharperCommand : BaseCommand<ResharperCommandSettings>
1212
{
1313
protected abstract string Title { get; }
1414

1515
protected abstract string GetCommand( BuildContext context, Solution solution );
1616

1717
protected virtual void OnSuccessfulExecution( BuildContext context, Solution solution ) { }
1818

19-
protected override bool ExecuteCore( BuildContext context, CommonCommandSettings settings )
19+
protected override bool ExecuteCore( BuildContext context, ResharperCommandSettings settings )
2020
{
2121
context.Console.WriteHeading( this.Title );
2222

@@ -31,9 +31,12 @@ protected override bool ExecuteCore( BuildContext context, CommonCommandSettings
3131
}
3232

3333
// Before formatting, the solution must be built.
34-
if ( !solution.Build( context, buildSettings ) )
34+
if ( !settings.NoBuild )
3535
{
36-
return false;
36+
if ( !solution.Build( context, buildSettings ) )
37+
{
38+
return false;
39+
}
3740
}
3841

3942
foreach ( var formattableSolution in solution.GetFormattableSolutions( context ) )
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Spectre.Console.Cli;
2+
using System.ComponentModel;
3+
4+
namespace PostSharp.Engineering.BuildTools.CodeStyle;
5+
6+
internal class ResharperCommandSettings : CommonCommandSettings
7+
{
8+
[Description( "Do not build the product before executing the command." )]
9+
[CommandOption( "--no-build" )]
10+
public bool NoBuild { get; protected set; }
11+
12+
}

src/PostSharp.Engineering.BuildTools/Resources/Build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ if (-not $Interactive -or $BuildArgs)
4040
# Change the working directory so we can use a global.json that is specific to eng.
4141
$previousLocation = Get-Location
4242

43-
Set-Location $PSScriptRoot\$EngPath\src
43+
Set-Location (Join-Path $PSScriptRoot $EngPath "src")
4444

4545
try
4646
{
4747

4848
# Run the project.
49-
& dotnet run --project "$PSScriptRoot\$EngPath\src\Build$ProductName.csproj" -- $BuildArgs
49+
& dotnet run --project (Join-Path $PSScriptRoot $EngPath "src" "Build$ProductName.csproj") -- $BuildArgs
5050

5151
if ($StartVsmon)
5252
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DotNetTool
2222

2323
public static DotNetTool SignClient { get; } = new SignTool();
2424

25-
public static DotNetTool Resharper { get; } = new( "jb", "JetBrains.Resharper.GlobalTools", "2025.2.0", "jb" );
25+
public static DotNetTool Resharper { get; } = new( "jb", "JetBrains.Resharper.GlobalTools", "2025.3.0-rc01", "jb" );
2626

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

0 commit comments

Comments
 (0)