cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.84k stars 722 forks source link

`InspectCode` calls the exe file even on Linux, where it doesn't work #4313

Open fdw opened 1 month ago

fdw commented 1 month ago

Prerequisites

Cake runner

Cake .NET Tool, Cake Frosting

Cake version

4.0.0

Operating system

Linux

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

I would like to run InspectCode on my solution. I have installed the ReSharper Command Line Tools, as they contain the same code as the NuGet package (but can be installed globally once). On Linux, they need a custom runtime, therefore should be started from inspectcode.sh and not inspectcode.exe. Therefore, I get the error

Failed to fill the environment container with handler ?{myArgs=?(2pcs)[/output:/output.xml, solution.sln]?}?. Could not find method '.ctor' due to a type load error: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:/opt/resharper/JetBrains.Platform.Util.dll type:ListEvents`1 member:(null)

Unfortunately, inspectcode.exe is hardcoded in Cake. I would like to see a switch based on the current OS.

What is expected?

If I run InspectCode on a Linux machine, inspectcode.sh is used instead of inspectcode.exe.

Steps to Reproduce

Call InspectCode on a Linux machine

Output log

See above for the error message

fdw commented 1 month ago

I'd like to add that almost all parameters also follow the Windows style of / instead of --.