首页 > 解决方案 > 如何在本地获得 JaCoCo 的整体覆盖?

问题描述

我有一个包含多个模块的 android 项目。主要模块是应用程序模块。

这是我所做的并且可以获得单独的报告。没有应用程序/构建报告。

zgong$ ./gradlew jacocoTestReport
zgong$ ls -la */build/reports/jacoco/jacocoTestReport/html/index.html
account/build/reports/jacoco/jacocoTestReport/html/index.html
bootstrap/build/reports/jacoco/jacocoTestReport/html/index.html
cards/build/reports/jacoco/jacocoTestReport/html/index.html
common/build/reports/jacoco/jacocoTestReport/html/index.html
explore/build/reports/jacoco/jacocoTestReport/html/index.html
launcher/build/reports/jacoco/jacocoTestReport/html/index.html
payment/build/reports/jacoco/jacocoTestReport/html/index.html
runtime/build/reports/jacoco/jacocoTestReport/html/index.html
settings/build/reports/jacoco/jacocoTestReport/html/index.html
transactions/build/reports/jacoco/jacocoTestReport/html/index.html
uibase/build/reports/jacoco/jacocoTestReport/html/index.html
widget/build/reports/jacoco/jacocoTestReport/html/index.html

我能得到像我在 Jenkins 报告中看到的那样的可视化报告吗?

标签: gradlejacocogradle-pluginjacoco-maven-plugin

解决方案


您需要将所有报告合并为一个。

这里有很多建议:https ://discuss.gradle.org/t/merge-jacoco-coverage-reports-for-multiproject-setups/12100/9


推荐阅读