我已经配置了一个Jenkins项目,它在gradle构建和测试后,调用"执行SonarQube Scanner"并使用下列规格:
这个成功运行了SonarQube并生成了一份报告,发送到IPaddress:9000,其中包括度量项:Bugs、Vulnerabilities、Debt、Code Smells和Duplications。但是,在这份报告中没有任何地方定义由测试覆盖的代码。SonarQube成功运行了Kotlin插件并看到了代码库本身,但未确定覆盖率。在使用Kotlin Android时,是否有可能使用SonarQube收集此信息?
我尝试安装Jacoco,但在SonarQube结果中没有看到任何新数据。
sonar.projectKey=my_project_key
sonar.projectName=my_Android
sonar.projectVersion=1.0
sonar.sources=app/src
sonar.java.binaries=app/build/intermediates/classes/debug
sonar.coverage.exclusions=app/src/test/**,app/src/androidTest/**,app/src/main/res/**
这个成功运行了SonarQube并生成了一份报告,发送到IPaddress:9000,其中包括度量项:Bugs、Vulnerabilities、Debt、Code Smells和Duplications。但是,在这份报告中没有任何地方定义由测试覆盖的代码。SonarQube成功运行了Kotlin插件并看到了代码库本身,但未确定覆盖率。在使用Kotlin Android时,是否有可能使用SonarQube收集此信息?
我尝试安装Jacoco,但在SonarQube结果中没有看到任何新数据。
sonar.jacoco.reportPath=build/jacoco/test.exec
我不确定这是否适用于Kotlin,但它对Java覆盖率有所帮助。希望这可以帮助到你,祝你好运! - Don