Search code examples
msbuildsonarqubesonarqube-msbuild-runner

How can I generate report from msbuild runner for sonarqube?


I've SonarQube 5.2 with msbuild runner 1.0.2 running fine and pushing results to server. All fine.

I would like to be able to generate reports of issues either as a result of runner or from SonarQube web. How can I do this?


Solution

  • Pass /d:sonar.analysis.mode=preview /d:sonar.issuesReport.html.enable=true to MSBuild.SonarQube.Runner.exe while issuing begin command

    MSBuild.SonarQube.Runner.exe begin /k:"codequalitysample" /n:"Code Quality Sample" /v:"1.0" /d:sonar.resharper.cs.reportPath="%CD%\ResharperInspectionResults.xml" /d:sonar.resharper.solutionFile="%CD%\CodeQualitySample.sln" /d:sonar.analysis.mode=preview /d:sonar.issuesReport.html.enable=true
    
    msbuild /t:Rebuild "%CD%\CodeQualitySample.sln"
    
    "%rctdir%\inspectcode.exe" /output="%CD%\ResharperInspectionResults.xml" "%CD%\CodeQualitySample.sln"
    
    MSBuild.SonarQube.Runner.exe end