This repository contains a build wrapper for run SonarQube analysis in a more automated way than the current SonarQube MSBuild Runner. The following features are available.
Run CxxSonarQubeMsbuidRunner.exe (/h to see the usage)
Example: CxxSonarQubeMsbuidRunner.exe /k:key /n:name /v:work /m:solution.sln > these are the mandatory arguments
in command line set /d:sonar.branch=your_branch /b:main_branch
. /d:sonar.branch is the regular prop for creating branch
. /b: is the target branch or master branch
This will create a new branch in sonar and copy all settings over to the feature bracnh from main. If you want branches to be independent you can skip the /b parameter, after that it will not copy any settings to the new branch
The wrapper will install the needed tools to run analysis, however in cases were internet is not available or user has no admin rights to install some softwares it is possible to use a settings file called cxx-user-options.xml in your home folder. The format is as follow.
<CxxUserProperties>
<CppCheck>c:\path</CppCheck>
<Rats>c:\path</Rats>
<Vera>c:\path</Vera>
<Python>c:\path</Python>
<Cpplint>c:\path</Cpplint>
<MsbuildRunnerPath>c:\path</MsbuildRunnerPath>
</CxxUserProperties>
Usage: CxxSonarQubeMsbuidRunner [OPTIONS]
Runs MSbuild Runner with Cxx Support
Options:
/A|/a:<amd64, disabled>
/B|/b:<parent_branch : in multi branch confiuration. Its parent branch>
/C|/c:<Permission template to apply when using feature branches>
/D|/d:<property to pass : /d:sonar.host.url=http://localhost:9000>
/E|/e reuse reports mode, cxx static tools will not run. Ensure reports are placed in default locations.
/F|/f disable code analysis in solution.
/G|/g enable verbose mode.
/I|/i wrapper will install tools only. No analysis is performed
/J|/j:<number of processor used for msbuild : /m:1 is default. 0 uses all processors /m>
/K|/k:<key : key>
/M|/m:<solution file : mandatory>
/N|/n:<name : name>
/P|/p:<additional settings for msbuild - /p:Configuration=Release>
/Q|/q:<SQ msbuild runner path>
/R|/r:<msbuild sonarqube runner -> 1.1>
/S|/s:<additional settings filekey>
/T|/t:<msbuild target, default is /t:Rebuild>
/V|/v:<version : version>
/X|/x:<version of msbuild : vs10, vs12, vs13, vs15, vs17, vs19 default is vs15>