DanielHWe / sonar-fxcop

FxCop plugin for C# or VB.NET projects
13 stars 6 forks source link

How to install your plugin? #36

Closed hanzelpeter closed 4 years ago

hanzelpeter commented 4 years ago

Hello.

We use SonarQube and I want to analyze C++/CLI DLL using FxCop. I searched on internet and here how to install your plugin but I was not able to find it.

Must it be install for SonarQube server? And how should I integrate it with MSBuild? I have no .SLN only just debug build of C++/CLI .DLL.

How can I scan it using your plugin and upload it to SonerQube?

DanielHWe commented 4 years ago

First the plugin must be installed on the onar qube server.

You can copy the jar file manually to $SONARQUBE_HOME/extensions/plugins on the server or install it from markedplace. See: https://docs.sonarqube.org/latest/setup/install-plugin/

Newest version of the jar can be found under Release: https://github.com/DanielHWe/sonar-fxcop/releases

hanzelpeter commented 4 years ago

Ok I see. But I don't know how it then integrates with Msbuild scanner. Do I need to download new msbuild scanner from our sonarqube server again? Or will it work unmodified?

Thanks for replay.

DanielHWe commented 4 years ago

This will work with the unmodified Msbuild scanner. But you have to define: "sonar.cs.fxcop.assembly", "sonar.cs.fxcop.fxCopCmdPath" and "sonar.cs.fxcop.directory". This can be done by parametes or SonarQube.Analysis.xml configuration. Or you define "sonar.cs.fxcop.slnFile" , "sonar.cs.fxcop.fxCopCmdPath" and "sonar.cs.fxcop.directory". Eg. by use of folowing commad: SonarQube.Scanner.MSBuild.exe begin /n:"MyProject" /v:"0.9.0.99" /k:"MyProject_key" /d:"sonar.cs.fxcop.slnFile=MyProject.sln" /d:"sonar.cs.fxcop.fxCopCmdPath=C:/Program Files (x86)/Microsoft Visual Studio 14.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe" /d:"sonar.cs.fxcop.directory=bin\debug"

hanzelpeter commented 4 years ago

Ok. Thanks a lot. Understood. I will install server plugin and use unmodified msbuild scanner.