Sonar Scanner for Swift/Obj C issue

  • ALM used :Bitbucket Cloud
  • CI system used : None
  • Scanner version:
INFO: SonarScanner
INFO: Java 13.0.2 AdoptOpenJDK (64-bit)
INFO: Mac OS X 10.14.6 x86_6
  • Scanner command used when applicable (private details masked)
    sonar-scanner -Dsonar.organization=myorg -Dsonar.projectKey=myprojkey -Dsonar.sources=. -Dsonar.login=xxxx

  • Build Wrapper Version: version 6.9 (macosx-x86)

  • Languages of the repository : Swift/Objective-C

  • Error observed
    ERROR: Error during SonarScanner execution
    java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:

  • Build Command
    build-wrapper-macosx-x86 --out-dir bw-output xcodebuild -workspace myxcworkspace -scheme myscheme clean build -allowProvisioningUpdates

The project is mainly swift project with some pods in objective-c. Swift scanning was done successfully after excluding CFamily files in the sonar-scanner command line options. I am now trying to scan CFamily files in the project. Downloaded build-wrapper-macosx-x86 and run the command. There are tons of lines inside build-wrapper-dump.json and it is not empty.

Hi @antimatter,

could you please share the sonar-scanner log in debug mode (passing -Dsonar.verbose=true) and the content of bw-output folder?

Due to NDA with customer, I am not able to share the entire log. Could I PM you instead? But I notice the .h and .m files are being ignored.

FBSDKTimeSpentData.m' is excluded by the scm ignore settings.
FBSDKUserDataStore.h' is excluded by the scm ignore settings.

They mostly exist in the Pods folder. Is there anyway to ask sonar scanner to ignore scm settings?

Here’s output of ls on bw-output.
ls bw-output
build-wrapper-dump.json build-wrapper.log

Hi @antimatter,

I am sending you a PM.