我一直致力于使用Objective-C设置SonarQube for和iOS Project。使用OCLint设置工具。
当我尝试为简单的Xcode项目设置SonarQube并且在设置具有多个.xcodeproj文件的工作空间的Xcode项目时失败,这是成功的。
在终端中运行run-sonar.sh文件时显示的警告是
Running OCLint...Skipping /Users/alex/Desktop/DemoWorkSpaceApp/SonarSampleWokspaceApp/. Compile command not found.
完成run-sonar.sh运行过程后,项目问题区域的声纳仪表板显示所有计数为0.如图所示
这是sonar-project.properties文件内容。
red metadata
sonar.projectKey=com.qb.SonarSampleWokspaceApp.SonarSampleWokspaceApp
sonar.projectName=SonarSampleWokspaceApp
sonar.projectVersion=1.0
# optional description
sonar.projectDescription=Interns project on Wear
# path to source directories (required)
sonar.sources=/Users/alex/Desktop/DemoWorkSpaceApp/SonarSampleWokspaceApp
# The value of the property must be the key of the language.
sonar.language=objc
# Xcode project configuration
sonar.objectivec.workspace=SonarSampleWokspaceApp.xcworkspace
sonar.objectivec.projects=SonarSampleWokspaceApp.xcodeproj
sonar.objectivec.appScheme=SonarSampleWokspaceApp
# Encoding of the source code
sonar.sourceEncoding=UTF-8
# JUnit report generated by run-sonar.sh is stored in sonar-reports/TEST-report.xml
# Change it only if you generate the file on your own
# The XML files have to be prefixed by TEST- otherwise they are not processed
sonar.junit.reportsPath=sonar-reports/
# Paths to exclude from coverage report (tests, 3rd party libraries etc.)
#sonar.objectivec.excludedPathsFromCoverage=.*Tests.*
我使用Alexs-Mac在终端中运行run-sonar.sh文件:SonarSampleWokspaceApp alex $ sudo ./run-sonar.sh
任何人都可以通过OCLint帮助解决Compile command not found
的这个问题。
答案 0 :(得分:2)
您的配置看起来不错。可能存在一些路径错误。
通过运行来跟踪您的问题:
sh run-sonar.sh -v
还会激活verbose
日志。如果这不能帮助您找到问题,请尝试运行:
sonar-runner -X
将显示full stack trace