Must-share information (formatted with Markdown):
-
SonarQube version: Version 9.5
-
what are you trying to achieve
Trying sonarqube analysis for .net projects -
what have you tried so far to achieve this
added following stepsPrepare Analysis Configuration task for SonarQube
-
task: SonarQubePrepare@4
inputs:
SonarQube: ‘project-reposqserviceconnection’
scannerMode: ‘MSBuild’
projectKey: ‘project-key’ -
task: MSBuild@1
displayName: ‘Build Solution’
inputs:
solution: ‘$(solutionName)’
platform: ‘$(buildPlatform)’
configuration: ‘${{ parameters.BuildConfiguration }}’
msbuildArguments: ‘$(buildTarget) $(buildParameters)’
-
Run Code Analysis task for SonarQube
- task: SonarQubeAnalyze@4
Publish Quality Gate Result task for SonarQube
- task: SonarQubePublish@4)
inputs:
pollingTimeoutSec: ‘300’
The build is passed. While SonarQubeAnalyze, i am getting following error regarding C/C++/Objective-C though i have added analysis only for .Net solutions.
##[error]The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper and setting the property “sonar.cfamily.build-wrapper-output” or by using Clang Compilation Database and setting the property “sonar.cfamily.compile-commands”. None of these two options were specified.
If you don’t want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-