-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for TFS team builds (MSBuild .SonarQube.Runner) #616
Comments
Sounds also interesting for others and should be documented. |
I have a few ideas on how to improve this, I will comment later as soon as On Thu, Aug 27, 2015, 16:44 Günter Wirth [email protected] wrote:
|
@jmecosta: What kind of improvement do you have in mind? I want to replace the windows batch with MSBuild commands in SonarQube.StaticAnalysis.props. I plan to do this some when in October. |
I have msbuild tasks and nuget packages for all those commands. see https://github.com/jmecosta/MSBuild-SonarQube-CXX i might add those ones to gallery so you can try... in the end you just On Thu, Aug 27, 2015, 21:41 Bert [email protected] wrote:
|
I see - I did not use F# until now and thought about a simple MSBuild core functionality but anyway if you have a solution this is highly appreciated. |
You mean automatically generate the includes based on the project file? I Why do you need to before the build target? I will try to work on this in September I hope I can put a small working On Thu, Aug 27, 2015, 22:31 Bert [email protected] wrote:
|
I enhanced the MS-Build configuration SonarQube.StaticAnalysis.props and now the batch file is obsolete. This is still not perfect but usable 😉 <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<SQLogLevel>INFO</SQLogLevel>
<SQCompiler>Visual C++</SQCompiler>
<SQCompilerLog>$(SolutionDir)$(SolutionName).log</SQCompilerLog>
<SQCompilerFF>UTF-16</SQCompilerFF>
<SQProjectFile>$(MSBuildProjectFullPath.Replace('\', '\\'))</SQProjectFile>
<!-- regex for VS log file without parallel build parameter "/maxcpucount:xx" -->
<SQCompilerRegEx>^(.*)\((\d+)\)\x20*:\x20warning\x20(C\d+):\x20(.*)\x20\[$(SQProjectFile)\]$</SQCompilerRegEx>
<SQCppCheckReport>cppcheck-report.xml</SQCppCheckReport>
<SQPClintReport>pclint-report.xml</SQPClintReport>
<SQVeraReport>vera-report.xml</SQVeraReport>
<SQRatsReport>rats-report.xml</SQRatsReport>
<SQCoverageReport>$(MSBuildProjectName).coveragexml</SQCoverageReport>
<SQTestReport>$(MSBuildProjectName).trx</SQTestReport>
<SQTestPattern>.*[ui]Test.*|Test.*|.*Tests?</SQTestPattern>
<SQSourceFiles>.cc,.cpp,.c,.cu</SQSourceFiles>
<SQHeaderFiles>.h,.hh,.hpp,.inl,.cuh,.inc,.cuinc</SQHeaderFiles>
<SQForceInclude>sonar-defines.h</SQForceInclude>
<CppCheckFast>true</CppCheckFast>
<!--ToDo adapt tool installation path -->
<SQInclude>../../src/_Globals/Include</SQInclude>
<!--PC-lint does not support C++11 yet -->
<PCLINT_SETTING>..\..\src\_Globals\PC-lint\VS2012.lnt</PCLINT_SETTING>
<SQTools>D:\sonar-tools</SQTools>
<PCLINT_ROOT>$(SQTools)\PC-Lint9</PCLINT_ROOT>
<CPPCHECK_ROOT>$(SQTools)\Cppcheck</CPPCHECK_ROOT>
<VERA_ROOT>$(SQTools)\Vera++-1.3.0.win</VERA_ROOT>
<RATS_ROOT>$(SQTools)\rats-2.3</RATS_ROOT>
</PropertyGroup>
<!--
***********************************************************************************************
SonarQube.StaticAnalysis.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
***********************************************************************************************
-->
<!-- Specify the ItemGroups to be analyzed
<PropertyGroup Condition=" $(SonarQubeTempPath) != '' ">
<SQAnalysisFileItemTypes>Compile;Content;EmbeddedResource;None;ClCompile;ClInclude;CudaCompile;Page;TypeScriptCompile</SQAnalysisFileItemTypes>
</PropertyGroup>
-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(SolutionDir)_Globals\SCA\NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(SolutionDir)_Globals\SCA\NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<!-- Define the list of files for analysis -->
<ItemGroup>
<CppFiles Include="**/*.cpp" />
<CppFiles Include="**/*.c" />
<CppFiles Include="**/*.inl" />
<CppFiles Include="**/*.h" />
<CppFiles Include="**/*.hpp" />
</ItemGroup>
<PropertyGroup>
<CppCheckInclude>CppCheck.includes</CppCheckInclude>
<LintMacros>mac-msc.cpp.lnt</LintMacros>
<LintProject>$(ProjectDir)$(ProjectName).lnt</LintProject>
<LintStdAfx>StdAfx.lph</LintStdAfx>
</PropertyGroup>
<Target Name="PC-lint" Condition="'$(BuildCmd)'!='Clean' And Exists('$(PCLINT_ROOT)')" AfterTargets="Build" Outputs="$(ProjectDir)$(SQPClintReport)" DependsOnTargets="UnitTestCheck">
<PropertyGroup>
<LintDefines>-D$([System.String]::Copy("%(ClCompile.PreprocessorDefinitions)").TrimEnd(';').Replace(";"," -D")) </LintDefines>
</PropertyGroup>
<Message Text="LintDefines = $(LintDefines)"/>
<!-- delete old report file -->
<Delete Files="$(ProjectDir)$(SQPClintReport)" Condition="'$(IsUnitTest)'=='False'" />
<!-- create a project lint file -->
<Delete Files="$(LintProject)" Condition="'$(IsUnitTest)'=='False'" />
<WriteLinesToFile Condition="'@(ClCompile)' != ''" File="$(LintProject)" Lines="%(ClCompile.RelativeDir)%(ClCompile.Filename)%(ClCompile.Extension)" Overwrite="false" Encoding="ASCII"/>
<!-- create lint defines from macros -->
<Exec Condition="'@(ClCompile)' != '' And '$(IsUnitTest)'=='False'" Command="cl.exe /EP /C /MD /GR /EHsc $(PCLINT_ROOT)\macros-msc.cpp >"$(LintMacros)"" />
<!-- add include folders -->
<WriteLinesToFile Condition="'$(Include)' != '' And '$(IsUnitTest)'=='False'" File="$(LintMacros)" Lines="-i"$(Include.TrimEnd(';').replace(`;`, `"%0a-i"`))"" Overwrite="false" Encoding="ASCII"/>
<WriteLinesToFile Condition="'%(ClCompile.AdditionalIncludeDirectories)' != ''" File="$(LintMacros)" Lines="-i"$([System.String]::Copy("%(ClCompile.AdditionalIncludeDirectories)").TrimEnd(';').Replace(";","%22%0a-i%22"))"" Overwrite="false" Encoding="ASCII"/>
<RemoveDupLine FilePath='$(LintMacros)' ContinueOnError='true'/>
<!-- execute pclint analysis -->
<Exec Condition="'@(ClCompile)' != '' And '$(IsUnitTest)'=='False'" Command="$(PCLINT_ROOT)\LINT-NT.EXE -i"$(PCLINT_ROOT)" -i"$([System.IO.Path]::GetDirectoryName($(PCLINT_SETTING)))" $(PCLINT_SETTING) "$(LintMacros)" $(LintDefines) -i$(IntDir) -pch(stdafx.h) "$(LintProject)"" IgnoreExitCode="yes" />
<!-- remove temp file -->
<Delete Files="$(ProjectDir)$(LintStdAfx)" Condition="'$(IsUnitTest)'=='False'" />
</Target>
<Choose>
<When Condition=" '$(Platform)'=='x64' ">
<PropertyGroup>
<CppCheckPlatform>win64</CppCheckPlatform>
</PropertyGroup>
</When>
<When Condition=" '$(Platform)'=='win32' ">
<Choose>
<When Condition=" '$(Characterset)'=='Unicode'">
<PropertyGroup>
<CppCheckPlatform>win32W</CppCheckPlatform>
</PropertyGroup>
</When>
<When Condition=" '$(Characterset)'=='MultiByte'">
<PropertyGroup>
<CppCheckPlatform>win32W</CppCheckPlatform>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<CppCheckPlatform>win32A</CppCheckPlatform>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
<Otherwise>
<PropertyGroup>
<CppCheckPlatform>native</CppCheckPlatform>
</PropertyGroup>
</Otherwise>
</Choose>
<Target Name="CppCheck" Condition="'$(BuildCmd)'!='Clean' And Exists('$(CPPCHECK_ROOT)')" AfterTargets="Build" Outputs="$(ProjectDir)$(SQCppCheckReport)" DependsOnTargets="UnitTestCheck">
<PropertyGroup>
<CppDefines>-D$([System.String]::Copy("%(ClCompile.PreprocessorDefinitions)").TrimEnd(';').Replace(";"," -D")) </CppDefines>
</PropertyGroup>
<Delete Files="$(CppCheckInclude)" Condition="'$(IsUnitTest)'=='False'"/>
<WriteLinesToFile Condition="'$(Include)' != '' And '$(CppCheckFast)' != 'true' And '$(IsUnitTest)'=='False'" File="$(CppCheckInclude)" Lines="$(Include.replace(`;`, `%0a`))" Overwrite="false" Encoding="ASCII"/>
<WriteLinesToFile Condition="'%(ClCompile.AdditionalIncludeDirectories)' != '' And '$(IsUnitTest)'=='False'" File="$(CppCheckInclude)" Lines="%(ClCompile.AdditionalIncludeDirectories)" Overwrite="false" Encoding="ASCII"/>
<WriteLinesToFile Condition="'%(ClCompile.AdditionalIncludeDirectories)' == '' And '$(IsUnitTest)'=='False'" File="$(CppCheckInclude)" Lines="%0a" Overwrite="false" Encoding="ASCII"/>
<RemoveLine FilePath='$(CppCheckInclude)' SearchText='..\..\..\boost\include' ContinueOnError='true'/>
<RemoveDupLine FilePath='$(CppCheckInclude)' ContinueOnError='true'/>
<Exec Condition="'@(ClCompile)' != '' And '$(IsUnitTest)'=='False'" Command="$(CPPCHECK_ROOT)\cppcheck.exe -v -q --platform=$(CppCheckPlatform) --enable=all --xml-version=2 --includes-file=$(CppCheckInclude) $(CppDefines) @(CppFiles->'%(Identity)', ' ') 2>"$(ProjectDir)$(SQCppCheckReport)"" IgnoreExitCode="yes" />
</Target>
<Target Name="Vera" Condition="'$(BuildCmd)'!='Clean' And Exists('$(VERA_ROOT)')" AfterTargets="Build" Outputs="$(ProjectDir)$(SQVeraReport)" DependsOnTargets="UnitTestCheck">
<Exec Condition="@(CppFiles)!='' And '$(IsUnitTest)'=='False'" Command="dir /s /B *.c *.cpp *.h *.hpp *.inl *.inc | $(VERA_ROOT)\bin\vera++.exe --root $(VERA_ROOT)\lib\vera++ --profile full --no-duplicate --show-rule --checkstyle-report "$(ProjectDir)$(SQVeraReport)"" ContinueOnError='true' IgnoreExitCode="yes" />
</Target>
<Target Name="Rats" Condition="'$(BuildCmd)'!='Clean' And Exists('$(RATS_ROOT)')" AfterTargets="Build" Outputs="$(ProjectDir)$(SQRatsReport)" DependsOnTargets="UnitTestCheck">
<Exec Condition="@(CppFiles)!='' And '$(IsUnitTest)'=='False'" Command="$(RATS_ROOT)\rats.exe -w 3 --xml @(CppFiles->'%(Identity)', ' ') >"$(ProjectDir)$(SQRatsReport)"" Timeout="300000" ContinueOnError='true' IgnoreExitCode="yes" />
</Target>
<Target Name = "UnitTestCheck" AfterTargets="Build">
<PropertyGroup>
<IsUnitTest>False</IsUnitTest>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Text.RegularExpressions.Regex]::Match($(ProjectName), $(SQTestPattern)))' != ''">
<IsUnitTest>True</IsUnitTest>
</PropertyGroup>
<Message Text="IsUnitTest = $(IsUnitTest)"/>
</Target>
<Target Name = "SQEnvCheck" AfterTargets="Build">
<Message Text="sonar.log.level = $(SQLogLevel)"/>
<Message Text="sonar.cxx.compiler.reportPath = $(SQCompilerLog)"/>
<Message Text="sonar.cxx.compiler.parser = $(SQCompiler)"/>
<Message Text="sonar.cxx.compiler.charset = $(SQCompilerFF)"/>
<Message Text="sonar.cxx.compiler.regex = $(SQCompilerRegEx)"/>
<Message Text="sonar.cxx.cppcheck.reportPath = $(SQCppCheckReport)"/>
<Message Text="sonar.cxx.pclint.reportPath = $(SQPClintReport)"/>
<Message Text="sonar.cxx.vera.reportPath = $(SQVeraReport)"/>
<Message Text="sonar.cxx.rats.reportPath = $(SQRatsReport)"/>
<Message Text="sonar.cxx.coverage.reportPath = $(SQCoverageReport)"/>
<Message Text="sonar.cxx.vstest.reportPaths = $(SQTestReport)"/>
<Message Text="sonar.cxx.suffixes.sources = $(SQSourceFiles)"/>
<Message Text="sonar.cxx.suffixes.headers = $(SQHeaderFiles)"/>
<Message Text="sonar.cxx.forceIncludes = $(SQForceInclude)"/>
<RemoveDuplicates Inputs="@(ClCompile->'%(AdditionalIncludeDirectories)')">
<Output
TaskParameter="Filtered"
ItemName="FilteredItems"/>
</RemoveDuplicates>
<PropertyGroup Label="UserMacros">
<AddIncludes>@(FilteredItems)</AddIncludes>
<SQIncludeDirectories Condition="'$(AddIncludes)'!=''">$(IncludePath.TrimEnd(';').replace(';', ',').replace('\','/')),$(AddIncludes.TrimEnd(';').replace(';',',').replace('\','/')),$(SQInclude)</SQIncludeDirectories>
<SQIncludeDirectories Condition="'$(AddIncludes)'==''">$(IncludePath.TrimEnd(';').replace(';', ',').replace('\','/')),$(SQInclude)</SQIncludeDirectories>
</PropertyGroup>
<ItemGroup>
<SonarQubeSetting Include="sonar.cxx.includeDirectories">
<Value>$(SQIncludeDirectories)</Value>
</SonarQubeSetting>
</ItemGroup>
<Message Text="sonar.cxx.includeDirectories = $(SQIncludeDirectories)"/>
</Target>
<PropertyGroup>
<MSBuildTaskAssembly Condition="'$(MSBuildToolsVersion)'<'14.0'" >$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll</MSBuildTaskAssembly>
<MSBuildTaskAssembly Condition="'$(MSBuildToolsVersion)'>='14.0'" >$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</MSBuildTaskAssembly>
</PropertyGroup>
<UsingTask TaskName="RemoveLine" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildTaskAssembly)">
<ParameterGroup>
<!--The file path is the full path to the text file-->
<FilePath ParameterType="System.String" Required="true" />
<!--The searchText will be removed-->
<SearchText ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
if (System.IO.File.Exists(FilePath))
{
Log.LogMessage("Remove string '{0}'.", SearchText);
var content = string.Empty;
using (System.IO.StreamReader reader = new StreamReader(FilePath))
{
content = reader.ReadToEnd();
reader.Close();
}
content = content.Replace(SearchText, "");
using (System.IO.StreamWriter writer = new StreamWriter(FilePath))
{
writer.Write(content);
writer.Close();
}
}
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="RemoveDupLine" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildTaskAssembly)">
<ParameterGroup>
<!--The file path is the full path to the text file-->
<FilePath ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
if (System.IO.File.Exists(FilePath))
{
string tempName = System.IO.Path.GetFileNameWithoutExtension(FilePath) + ".bak";
System.IO.File.Copy(FilePath, tempName, true);
System.IO.File.Delete(FilePath);
var sr = new System.IO.StreamReader(tempName);
var sw = new System.IO.StreamWriter(FilePath);
var lines = new System.Collections.Generic.HashSet<int>();
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
if (line.Length == 0)
continue;
int hc = line.GetHashCode();
if(lines.Contains(hc))
continue;
lines.Add(hc);
sw.WriteLine(line);
}
sw.Flush();
sw.Close();
sr.Close();
}
]]>
</Code>
</Task>
</UsingTask>
<ItemGroup>
<SonarQubeSetting Include="sonar.log.level">
<Value>$(SQLogLevel)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.compiler.reportPath">
<Value>$(SQCompilerLog)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.compiler.parser">
<Value>$(SQCompiler)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.compiler.charset">
<Value>$(SQCompilerFF)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.compiler.regex">
<Value>$(SQCompilerRegEx)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.cppcheck.reportPath">
<Value>$(SQCppCheckReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.pclint.reportPath">
<Value>$(SQPClintReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.vera.reportPath">
<Value>$(SQVeraReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.rats.reportPath">
<Value>$(SQRatsReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.coverage.reportPath">
<Value>$(SQCoverageReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.vstest.reportPaths">
<Value>$(SQTestReport)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.suffixes.sources">
<Value>$(SQSourceFiles)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.suffixes.headers">
<Value>$(SQHeaderFiles)</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.cxx.forceIncludes">
<Value>$(SQForceInclude)</Value>
</SonarQubeSetting>
</ItemGroup>
<ItemGroup>
<BuildMacro Include="SQCompiler">
<Value>$(SQCompiler)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQProjectFile">
<Value>$(SQProjectFile)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQCompilerLog">
<Value>$(SQCompilerLog)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQCompilerFF">
<Value>$(SQCompilerFF)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQCompilerRegEx">
<Value>$(SQCompilerRegEx)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQCppCheckReport">
<Value>$(SQCppCheckReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQPClintReport">
<Value>$(SQPClintReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQVeraReport">
<Value>$(SQVeraReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQRatsReport">
<Value>$(SQRatsReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQCoverageReport">
<Value>$(SQCoverageReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQTestReport">
<Value>$(SQTestReport)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQSourceFiles">
<Value>$(SQSourceFiles)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="SQHeaderFiles">
<Value>$(SQHeaderFiles)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="PCLINT_ROOT">
<Value>$(PCLINT_ROOT)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>
|
@Bertk did you tried the https://github.com/jmecsoftware/sonar-cxx-msbuild-tasks/releases ? the reason i mention this is that you dont need to patch anything in the SonarQube.StaticAnalysis.props (it will do it for you). perhaps you could try and try to merge some of the missing things you have defined above |
@jmecosta I just tried to install the Nuget packages for CppCheck, RatsCheck and VeraCheck but VS freezes while the installation for the projects is done and only a small number of projects is initialized. |
You don't need to install the nuget packages. You can use the 1.3 of the Anyway for the nugets try installing from vs console with detailed info, On Wed, Dec 30, 2015, 08:34 Bert [email protected] wrote:
|
The NuGet manager updates the project file for example with: <ImportGroup Label="ExtensionTargets">
<Import Project="$(CUDAPropsPath)\CUDA 7.5.targets" />
<Import Project="..\..\packages\VeraTask.1.0.4\build\VeraTask.targets" Condition="Exists('..\..\packages\VeraTask.1.0.4\build\VeraTask.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\VeraTask.1.0.4\build\VeraTask.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\VeraTask.1.0.4\build\VeraTask.targets'))" />
</Target>
The 3 packages are installed already but without this entries the package dependency is not defined? |
That is what is suppose to do. Just adds those target files. Not sure what On Wed, Dec 30, 2015, 11:56 Bert [email protected] wrote:
|
@jmecosta I created some issues for sonar-cxx-msbuild-tasks and will continue testing next week. Further results will be available here https://github.com/jmecsoftware/sonar-cxx-msbuild-tasks. I should have been more precise - at least the build depends on the packages in regards to static code analysis results. |
@Bertk you mean for example vera++ does not get installed with the nuget package. its kind of one purpose, you need to install those and pass the paths as arguments to the build. thats the reason, why i prefer the runner since its installs everything for you. we use those nuget packages because we have a main configuration.props that contains those definitions. i am ensure if even i can redistribute those with the nuget package i am ensure about the licensing on those |
@bert would create a new item under HowTo.
|
@bert what are you planning to document, can we combine it with my wrapper On Sun, 17 Apr 2016 11:50 Günter Wirth, [email protected] wrote:
|
@jmecosta I would like to bring the VS props file to the wiki or a folder as a template for other static analysis tools. The MSbuild task defined in the VS props file are executed after the build and the report files are created. This is just another scripting solution to generate the report files. In fact, I also extended the script for automatic unit test execution. Unfortunately the unit testing is not a generic solution. |
@Bertk can we close this? |
Yes, can be closed. |
@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:
Final statement ->
This works also for C++
and the TFS build report shows this:
The text was updated successfully, but these errors were encountered: