C/C++/Objective-C files are not getting analyzed

  1. SonarQube version - Developer Edition Version 8.3.1 (build 34397)
  2. Azure pipelines agent version - Agent.Version 2.163.1 (Java, typescript is already installed)

I am trying to perform a static code analysis on objc files using Azure DevOps and using build-wrapper while doing build. below is the command -

‘’’ build-wrapper-macosx-x86 --out-dir /Users/runner/work/61/s/**/platforms/ios xcodebuild clean build -UseModernBuildSystem=NO ‘’’

Below are the parameters am using to perform analysis.
Sonar properties being used in “Prepare analysis on sonarqube” task -

sonar.exclusions=platforms/**/*, node_modules/**/*, **/*.java, **/*.js, **/*.ts, **/*.cs
sonar.sources=/Users/runner/work/61/s/**/plugins
sonar.branch.name=ios
sonar.cfamily.cache.enabled=false
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=.m
sonar.cfamily.build-wrapper-output=/Users/runner/work/61/s/**/platforms/ios

Below is the error am getting in the “Run code analysis” task -

##[error]07:17:14.039 ERROR: Error during SonarScanner execution
##[debug]Processed: ##vso[task.logissue type=error;]07:17:14.039 ERROR: Error during SonarScanner execution
07:17:14.039 ERROR: Error during SonarScanner execution
##[error]java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * you are correctly invoking the scanner with correct configuration
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * you are providing the path to the correct build-wrapper output directory
  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
##[debug]Processed: ##vso[task.logissue type=error;]

##[error]at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:397)
##[debug]Processed: ##vso[task.logissue type=error;]at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:397)
##[debug]Processed: 	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:397)##vso[task.logissue type=error;]

##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
##[debug]Processed: ##vso[task.logissue type=error;]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)

##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
##[debug]Processed: ##vso[task.logissue type=error;]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
##[debug]Processed: 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)##vso[task.logissue type=error;]

##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
##[debug]Processed: ##vso[task.logissue type=error;]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
##[debug]Processed: 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)##vso[task.logissue type=error;]

##[error]at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
##[debug]Processed: ##vso[task.logissue type=error;]at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
##[debug]Processed: 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)##vso[task.logissue type=error;]

##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
##[debug]Processed: ##vso[task.logissue type=error;]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
##[debug]Processed: 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)##vso[task.logissue type=error;]

Hi,

Based on the location of your build wrapper file, I’m guessing that your first exclusion, platforms/**/*, is excluding your files of interest.

If not, maybe you can provide an analysis log?

 
Ann