we are using sonarqube * Developer Edition Version 8.9.7 (build 52159). We have an IOS application which was developed using swift language. our requirement is to generate a code coverage report and convert it into a format readable by sonarqube so the code coverage percent will be displayed on the project dashboard.
We have generated a coverage report using multiple ways like slather and also using the command
xcodebuild -project project.xcodeproj -scheme SCHEME-destination ‘platform=iOS Simulator,name=iPhone xxxxxx’ -configuration Debug ENABLE_CODE_COVERAGE=YES clean build test. the report is being generated in .xcreport format and i have tried converting it into xml format by following this sonar-scanning-examples/swift-coverage/swift-coverage-example/xccov-to-sonarqube-generic.sh at master · SonarSource/sonar-scanning-examples · GitHub. so i have created a .sh file and copied the contents of the file and used the below command
bash xccov-to-sonarqube-generic.sh Build/Logs/Test/Run-swift-coverage-example-2023.01.27_16-07-44-+0100.xcresult/ >Coverage.xml
this is converting the file to Coverage.xml format but the thing is when executing the sonar-scan command we see the following error
INFO: ------------- Run sensors on project
INFO: Sensor Generic Coverage Report
INFO: Parsing /Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/Logs/Test/coverage.xml
INFO: Imported coverage data for 0 files
INFO: Coverage data ignored for 492 unknown files, including:
/Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/SourcePackages/checkouts/KeychainAccess/Lib/KeychainAccess/Keychain.swift
/Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/SourcePackages/checkouts/pexip-swift-sdk/Sources/PexipCore/DataChannel.swift
/Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/SourcePackages/checkouts/pexip-swift-sdk/Sources/PexipCore/DTMFSignals.swift
/Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/SourcePackages/checkouts/pexip-swift-sdk/Sources/PexipCore/IceServer.swift
/Users/xxxx/Library/Developer/Xcode/DerivedData/Project-fffqrfnevokmtpeqhsuprnfzjfkl/SourcePackages/checkouts/pexip-swift-sdk/Sources/PexipCore/Isolated.swift
INFO: Sensor Generic Coverage Report (done) | time=97ms
INFO: Sensor Zero Coverage Sensor
Is anyone facing the same issue?Can someone please help me on this?
Thankyou in advance