Hi I can see the same issue when I run sonar-scanner from my terminal.
I just configured a brand new Macbook Pro Machine with the M1 Pro Chip and I have a project which is a mix of objc and swift. That project was using the build-wrapper which I found not working anymore so as suggested by this ticket [CPP-2882] Build-wrapper and analyzer should run on macOS arm64 aka Apple Silicon - SonarSource I was trying to use the Json Compilation Database but with no success.
I am running sonar scanner after the unit test as part of the build pipeline through fastlane.
scan(
scheme: "SchemeName",
devices: ["iPad Pro (9.7-inch)"],
code_coverage: true,
derived_data_path: "derived_data",
output_types: "json-compilation-database",
use_clang_report_name: true
)
The above will generate the compile_commands.json
file inside the fastlane folder.
desc "SonarQube analysis"
lane :sonarqube do
sonar(
sonar_runner_args: "-X",
)
This will call sonar to run.
And this is the properties file
sonar-project.properties
sonar.cfamily.compile-commands=compile_commands.json
sonar.sourceEncoding=UTF-8
sonar.cfamily.cache.enabled=false
sonar.cfamily.cache.path=../sonar_cache
sonar.coverage.exclusions=TestTargetName/**/*,test/*,Folder/main.m
sonar.cpd.exclusions= Folder/DatecsLibraries/**/*, TestTargetName/**/*,test/**/*
sonar.exclusions=**/*.xml,Pods/**/*,Reports/**/*,node_modules/*
sonar.host.url=https://sonarqube.companyname.com/
sonar.language=objc
sonar.projectName=ProjectName
sonar.projectKey=ProjectKey
sonar.sources = .
sonar.test.inclusions=**/*Test*/**
sonar.test.inclusions=*.h,*.m
sonar.tests=TestTargetName