Skip to content

Support for TFS team builds (MSBuild .SonarQube.Runner) #616

@Bertk

Description

@Bertk

@guwirth, @wenns, @jmecosta: Shouldn't we add this to the Wiki?
The new SQ tool “MSBuild SonarQube Runner” simplifies the TFS Team build integration and I could successfully analyze the CppCheck C++ sources using the C++ Community plug-in. I followed the installation description form Microsoft ALM rangers SonarQube Setup Guide For .NET Users and used for my tests the TFS 2015 Express edition.
My goal was to use MSVC++, PC-lint, CppCheck, RATS and Vera++ reports for a daily build scenario. All tool reports are created and stored in the SQ DB with one build and after a small modification to support the MSVC++ solution log (df04208) also the compiler warnings showed up. The SQ instance has now a multi-module project based on the Visual Studio solution file 😁
I used the following C++ VS property file for the MS-Build configuration “SonarQube.StaticAnalysis.props”:

SonarQube.StaticAnalysis.props was replaced with updated version - see below

I added this property file to the folder with the solution file and added the reference to the usual import groups settings of the visual studio project:

...
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(SolutionDir)\SonarQube.StaticAnalysis.props" />
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
  </ImportGroup>
...

Final statement ->

This works also for C++

and the TFS build report shows this:
capture

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions