cake-contrib / Cake.Sonar

:cake: :jigsaw: Cake addin to execute the MSBuild scanner for SonarQube in Cake builds
https://cakebuild.net/extensions/cake-sonar/
MIT License
31 stars 24 forks source link

Use dotnet-sonarscanner package for dotnet core #96

Closed twenzel closed 3 years ago

twenzel commented 4 years ago

You might use the dotnet-sonarscanner package for dotnet core instead of your own MSBuild.SonarQube.Runner.Tool.

The advantage would be to get updates faster (direct from vendor) instead of waiting for community contributions.

HofmeisterAn commented 3 years ago

@twenzel I took a quick look into the implementation and noticed CORECLR_TOOL_NAME. You can simply add the dotnet-sonarscanner from SonarSource to your Cake build and set UseCoreClr to true. This will use the dotnet tool.

#tool nuget:?package=dotnet-sonarscanner&version=5.0.4

var sonarBeginSettings = new SonarBeginSettings();
sonarBeginSettings.UseCoreClr = true;
// Your configuration.
twenzel commented 3 years ago

Unfortunately this does not use the dotnet tool.

We're launching for CoreCLR with executable C:/Agents/smith04.01/_work/79/s/tools/MSBuild.SonarQube.Runner.Tool.4.8.0/tools/sonar-scanner-msbuild-4.8.0.12008-netcoreapp3.0/SonarScanner.MSBuild.dll

HofmeisterAn commented 3 years ago

I'm pretty sure it does. I use it in a couple of builds e. g. here. Did you add the package to Cake? This is my task.

twenzel commented 3 years ago

@HofmeisterAn You were right. The problem was, that I also had referenced the old MSBuild.SonarQube.Runner.Tool. Now it's working fine, thanks,