From c363089ae93c44e03598c03609fe4d05e6a05b5c Mon Sep 17 00:00:00 2001 From: Sergey Shanshin Date: Tue, 16 May 2023 15:11:23 +0300 Subject: [PATCH] Improved Kover documentation PR #369 Co-authored-by: Leonid Startsev Co-authored-by: Vsevolod Tolstopyatov --- README.md | 373 +-------------- api/kover-gradle-plugin.api | 5 +- build.gradle.kts | 2 +- docs/_config.yml | 12 + docs/assets/css/style.scss | 16 + docs/cli/index.md | 148 ++++++ .../-kover-android-extension/index.html | 111 ----- .../-kover-android-extension/report.html | 72 --- .../-kover-general-android-report/html.html | 72 --- .../-kover-general-android-report/verify.html | 72 --- .../-kover-general-android-report/xml.html | 72 --- .../index.html | 115 ----- .../index.html | 96 ---- .../index.html | 96 ---- .../-kover-jvm-source-set/index.html | 96 ---- .../-kover-mpp-source-set/compilation.html | 72 --- .../-kover-mpp-source-set/index.html | 111 ----- .../-kover-mpp-source-set/target-name.html | 72 --- ...e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html | 72 --- .../exclude-sources.html | 72 --- .../-kover-sources-exclusions/index.html | 130 ------ .../-kover-sources-exclusions/jvm.html | 72 --- .../-kover-sources-exclusions/mpp.html | 72 --- ...t-o-o-l_-m-i-n-i-m-a-l_-v-e-r-s-i-o-n.html | 72 --- docs/gradle-plugin/configuring.md | 433 ++++++++++++++++++ .../development/functionalTests.md | 0 .../-c-o-v-e-r-e-d_-c-o-u-n-t/index.html | 0 .../index.html | 0 .../-m-i-s-s-e-d_-c-o-u-n-t/index.html | 0 .../index.html | 0 .../-aggregation-type/index.html | 0 .../-aggregation-type/is-percentage.html | 0 .../-aggregation-type/value-of.html | 0 .../-aggregation-type/values.html | 0 .../-a-p-p-l-i-c-a-t-i-o-n/index.html | 0 .../-c-l-a-s-s/index.html | 0 .../-p-a-c-k-a-g-e/index.html | 0 .../-grouping-entity-type/index.html | 0 .../-grouping-entity-type/value-of.html | 0 .../-grouping-entity-type/values.html | 0 .../-kover-default-reports-config/index.html | 156 +++++++ .../merge-with.html} | 10 +- .../-kover-html-report-config/charset.html} | 10 +- .../-kover-html-report-config}/filters.html | 4 +- .../-kover-html-report-config/index.html | 17 +- .../-kover-html-report-config/on-check.html | 0 .../set-report-dir.html | 0 .../-kover-html-report-config}/title.html | 6 +- .../classes.html | 0 .../index.html | 0 .../packages.html | 0 ...u-l-t_-h-t-m-l_-r-e-p-o-r-t_-n-a-m-e.html} | 10 +- ...t_-v-e-r-i-f-y_-r-e-p-o-r-t_-n-a-m-e.html} | 10 +- ...a-u-l-t_-x-m-l_-r-e-p-o-r-t_-n-a-m-e.html} | 10 +- ...y_-c-o-n-f-i-g-u-r-a-t-i-o-n_-n-a-m-e.html | 0 ...o-j-e-c-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html | 0 ...-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html} | 10 +- .../-kover-names/index.html | 0 .../-kover-project-extension/disable.html} | 10 +- .../exclude-instrumentation.html | 0 .../exclude-java-code.html | 6 +- .../exclude-tests.html | 0 .../-kover-project-extension/index.html | 23 +- .../-kover-project-extension/use-jacoco.html} | 10 +- .../android-reports.html} | 10 +- .../-kover-report-extension/defaults.html | 72 +++ .../-kover-report-extension/filters.html | 0 .../-kover-report-extension/index.html | 0 .../-kover-report-filter/annotated-by.html | 0 .../-kover-report-filter/classes.html | 0 .../-kover-report-filter/index.html | 0 .../-kover-report-filter/packages.html | 0 .../-kover-report-filters/excludes.html | 0 .../-kover-report-filters/includes.html | 0 .../-kover-report-filters/index.html | 0 .../-kover-reports-config}/filters.html | 6 +- .../-kover-reports-config}/html.html | 4 +- .../-kover-reports-config}/index.html | 45 +- .../-kover-reports-config}/verify.html | 4 +- .../-kover-reports-config}/xml.html | 4 +- .../-kover-tests-exclusions/index.html | 0 .../mpp-target-name.html | 0 .../-kover-tests-exclusions/tasks.html | 0 .../-kover-verify-bound/aggregation.html | 0 .../-kover-verify-bound/index.html | 0 .../-kover-verify-bound/max-value.html | 0 .../-kover-verify-bound/metric.html | 0 .../-kover-verify-bound/min-value.html | 0 .../-kover-verify-report-config/index.html | 0 .../-kover-verify-report-config/on-check.html | 0 .../-kover-verify-report-config}/rule.html | 4 +- .../-kover-verify-rule/bound.html | 0 .../-kover-verify-rule/entity.html | 0 .../-kover-verify-rule/filters.html | 0 .../-kover-verify-rule/index.html | 0 .../-kover-verify-rule/is-enabled.html | 0 .../-kover-verify-rule/max-bound.html | 0 .../-kover-verify-rule/min-bound.html | 0 ...t-o-o-l_-d-e-f-a-u-l-t_-v-e-r-s-i-o-n.html | 0 .../-k-o-v-e-r_-t-o-o-l_-v-e-r-s-i-o-n.html} | 10 +- ...n-i-m-u-m_-g-r-a-d-l-e_-v-e-r-s-i-o-n.html | 0 .../-kover-versions/index.html | 0 .../-kover-xml-report-config}/filters.html | 4 +- .../-kover-xml-report-config/index.html | 0 .../-kover-xml-report-config/on-check.html | 0 .../set-report-file.html | 0 .../-metric-type/-b-r-a-n-c-h/index.html | 0 .../-i-n-s-t-r-u-c-t-i-o-n/index.html | 0 .../-metric-type/-l-i-n-e/index.html | 0 .../-metric-type/index.html | 0 .../-metric-type/value-of.html | 0 .../-metric-type/values.html | 0 .../index.html | 0 .../-kover-gradle-plugin.html | 0 .../-kover-gradle-plugin/apply.html | 0 .../-kover-gradle-plugin/index.html | 0 .../kotlinx.kover.gradle.plugin/index.html | 0 .../dokka/-kover -gradle -plugin/package-list | 6 +- .../dokka/images/anchor-copy-button.svg | 0 .../dokka/images/arrow_down.svg | 0 .../dokka/images/copy-icon.svg | 0 .../dokka/images/copy-successful-icon.svg | 0 .../dokka/images/footer-go-to-link.svg | 0 .../dokka/images/go-to-top-icon.svg | 0 .../dokka/images/logo-icon.svg | 0 .../nav-icons/abstract-class-kotlin.svg | 0 .../dokka/images/nav-icons/abstract-class.svg | 0 .../images/nav-icons/annotation-kotlin.svg | 0 .../dokka/images/nav-icons/annotation.svg | 0 .../dokka/images/nav-icons/class-kotlin.svg | 0 .../dokka/images/nav-icons/class.svg | 0 .../dokka/images/nav-icons/enum-kotlin.svg | 0 .../dokka/images/nav-icons/enum.svg | 0 .../images/nav-icons/exception-class.svg | 0 .../dokka/images/nav-icons/field-value.svg | 0 .../dokka/images/nav-icons/field-variable.svg | 0 .../dokka/images/nav-icons/function.svg | 0 .../images/nav-icons/interface-kotlin.svg | 0 .../dokka/images/nav-icons/interface.svg | 0 .../dokka/images/nav-icons/object.svg | 0 .../dokka/images/theme-toggle.svg | 0 docs/{ => gradle-plugin}/dokka/index.html | 0 .../{ => gradle-plugin}/dokka/navigation.html | 0 .../dokka/scripts/clipboard.js | 0 .../{ => gradle-plugin}/dokka/scripts/main.js | 0 .../dokka/scripts/navigation-loader.js | 0 .../dokka/scripts/pages.json | 2 +- .../dokka/scripts/platform-content-handler.js | 0 .../dokka/scripts/prism.js | 0 .../dokka/scripts/sourceset_dependencies.js | 0 .../symbol-parameters-wrapper_deferred.js | 0 .../dokka/styles/jetbrains-mono.css | 0 .../dokka/styles/logo-styles.css | 0 .../{ => gradle-plugin}/dokka/styles/main.css | 0 .../dokka/styles/prism.css | 0 .../dokka/styles/style.css | 0 docs/gradle-plugin/index.md | 305 ++++++++++++ .../migrations}/migration-to-0.6.0.md | 0 .../migrations}/migration-to-0.7.0.md | 29 +- examples/jvm/defaults/build.gradle.kts | 2 - .../functional/framework/checker/Checker.kt | 3 +- .../framework/writer/BuildScriptWriter.kt | 5 +- .../framework/writer/KoverWriter.kt | 12 +- .../kotlin/kotlinx/kover/api/CoverageTools.kt | 8 +- .../kover/gradle/plugin/commons/Constants.kt | 2 +- .../plugin/dsl/KoverProjectExtension.kt | 10 +- .../dsl/internal/KoverProjectExtension.kt | 9 +- toolset/kover-cli/README.md | 145 +----- .../cli/commands/OfflineInstrumentCommand.kt | 2 +- .../kotlinx/kover/cli/tests/SimpleTests.kt | 2 +- .../kover-offline-runtime/build.gradle.kts | 2 +- 171 files changed, 1309 insertions(+), 2226 deletions(-) create mode 100644 docs/_config.yml create mode 100644 docs/assets/css/style.scss create mode 100644 docs/cli/index.md delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/report.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/html.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/verify.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/xml.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-verify-report-config/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-xml-report-config/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-jvm-source-set/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/compilation.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/target-name.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-r-e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-sources.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/index.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/jvm.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/mpp.html delete mode 100644 docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-m-i-n-i-m-a-l_-v-e-r-s-i-o-n.html create mode 100644 docs/gradle-plugin/configuring.md rename docs/{ => gradle-plugin}/development/functionalTests.md (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-c-o-u-n-t/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-p-e-r-c-e-n-t-a-g-e/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-c-o-u-n-t/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-p-e-r-c-e-n-t-a-g-e/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/is-percentage.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/value-of.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/values.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-a-p-p-l-i-c-a-t-i-o-n/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-c-l-a-s-s/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-p-a-c-k-a-g-e/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/value-of.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/values.html (100%) create mode 100644 docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/index.html rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/common.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/merge-with.html} (79%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/disabled-for-project.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config/charset.html} (80%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config}/filters.html (93%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config/index.html (87%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config/on-check.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config/set-report-dir.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-html-report-config}/title.html (93%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-instrumentation-exclusions/classes.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-instrumentation-exclusions/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-instrumentation-exclusions/packages.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-h-t-m-l_-r-e-p-o-r-t_-n-a-m-e.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-d-e-f-a-u-l-t_-h-t-m-l_-r-e-p-o-r-t_-n-a-m-e.html} (91%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-v-e-r-i-f-y_-r-e-p-o-r-t_-n-a-m-e.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-d-e-f-a-u-l-t_-v-e-r-i-f-y_-r-e-p-o-r-t_-n-a-m-e.html} (91%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-x-m-l_-r-e-p-o-r-t_-n-a-m-e.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-d-e-f-a-u-l-t_-x-m-l_-r-e-p-o-r-t_-n-a-m-e.html} (91%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-d-e-p-e-n-d-e-n-c-y_-c-o-n-f-i-g-u-r-a-t-i-o-n_-n-a-m-e.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-p-r-o-j-e-c-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-a-n-d-r-o-i-d_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html} (85%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/index.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/use-kover-tool.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/disable.html} (84%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-instrumentation.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension}/exclude-java-code.html (85%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-tests.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/index.html (81%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/use-jacoco-tool.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/use-jacoco.html} (74%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-jvm-source-set/source-set-name.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/android-reports.html} (63%) create mode 100644 docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/defaults.html rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/filters.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/annotated-by.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/classes.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/packages.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/excludes.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/includes.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/index.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config}/filters.html (82%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config}/html.html (94%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config}/index.html (76%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config}/verify.html (94%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config}/xml.html (94%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-tests-exclusions/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-tests-exclusions/mpp-target-name.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-tests-exclusions/tasks.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-bound/aggregation.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-bound/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-bound/max-value.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-bound/metric.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-bound/min-value.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-report-config/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-report-config/on-check.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-verify-report-config => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-report-config}/rule.html (95%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/bound.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/entity.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/filters.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/is-enabled.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/max-bound.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-verify-rule/min-bound.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-j-a-c-o-c-o_-t-o-o-l_-d-e-f-a-u-l-t_-v-e-r-s-i-o-n.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-d-e-f-a-u-l-t_-v-e-r-s-i-o-n.html => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-v-e-r-s-i-o-n.html} (85%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-m-i-n-i-m-u-m_-g-r-a-d-l-e_-v-e-r-s-i-o-n.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/index.html (100%) rename docs/{dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-xml-report-config => gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-xml-report-config}/filters.html (93%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-xml-report-config/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-xml-report-config/on-check.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-xml-report-config/set-report-file.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/-b-r-a-n-c-h/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/-i-n-s-t-r-u-c-t-i-o-n/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/-l-i-n-e/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/value-of.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-metric-type/values.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin/-kover-gradle-plugin/-kover-gradle-plugin.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin/-kover-gradle-plugin/apply.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin/-kover-gradle-plugin/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin/index.html (100%) rename docs/{ => gradle-plugin}/dokka/-kover -gradle -plugin/package-list (97%) rename docs/{ => gradle-plugin}/dokka/images/anchor-copy-button.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/arrow_down.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/copy-icon.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/copy-successful-icon.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/footer-go-to-link.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/go-to-top-icon.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/logo-icon.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/abstract-class-kotlin.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/abstract-class.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/annotation-kotlin.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/annotation.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/class-kotlin.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/class.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/enum-kotlin.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/enum.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/exception-class.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/field-value.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/field-variable.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/function.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/interface-kotlin.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/interface.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/nav-icons/object.svg (100%) rename docs/{ => gradle-plugin}/dokka/images/theme-toggle.svg (100%) rename docs/{ => gradle-plugin}/dokka/index.html (100%) rename docs/{ => gradle-plugin}/dokka/navigation.html (100%) rename docs/{ => gradle-plugin}/dokka/scripts/clipboard.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/main.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/navigation-loader.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/pages.json (52%) rename docs/{ => gradle-plugin}/dokka/scripts/platform-content-handler.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/prism.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/sourceset_dependencies.js (100%) rename docs/{ => gradle-plugin}/dokka/scripts/symbol-parameters-wrapper_deferred.js (100%) rename docs/{ => gradle-plugin}/dokka/styles/jetbrains-mono.css (100%) rename docs/{ => gradle-plugin}/dokka/styles/logo-styles.css (100%) rename docs/{ => gradle-plugin}/dokka/styles/main.css (100%) rename docs/{ => gradle-plugin}/dokka/styles/prism.css (100%) rename docs/{ => gradle-plugin}/dokka/styles/style.css (100%) create mode 100644 docs/gradle-plugin/index.md rename docs/{ => gradle-plugin/migrations}/migration-to-0.6.0.md (100%) rename docs/{ => gradle-plugin/migrations}/migration-to-0.7.0.md (96%) diff --git a/README.md b/README.md index 4efc274a..70595f35 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,34 @@ -# Kover Gradle Plugin +# Kover [![Kotlin Alpha](https://kotl.in/badges/alpha.svg)](https://kotlinlang.org/docs/components-stability.html) [![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) -Gradle plugin for Kotlin code coverage tools: [Kover](https://github.com/JetBrains/intellij-coverage) -and [JaCoCo](https://github.com/jacoco/jacoco). - -Minimum supported version of `Gradle` is `6.8`. - +Kotlin Code Coverage Toolset +For more information about Kover Gradle Plugin, please refer to the [documentation of the latest release](https://kotlin.github.io/kotlinx-kover/gradle-plugin). -For more information about recent stable release, please refer to the [documentation of the latest release](https://Kotlin.github.io/kotlinx-kover) +For more information about Kover CLI, please refer to the [documentation of the latest release](https://kotlin.github.io/kotlinx-kover/cli). ## Features -* Collection of code coverage through `JVM` test tasks (JS and native targets are not supported yet). +* Collection of code coverage through `JVM` tests (JS and native targets are not supported yet). * generating `HTML` and `XML` reports. * Support for `Kotlin JVM`, `Kotlin Multiplatform` projects. * Support for `Kotlin Android` projects with build variants (instrumentation tests executing on the Android device are not supported yet). * Support mixed `Kotlin` and `Java` sources -* Verification rules with bounds to keep track of coverage. -* Using Kover or JaCoCo Coverage tools for coverage measuring and report generation. +* Verification rules with bounds in the Gradle plugin to keep track of coverage. +* Using JaCoCo library in Gradle plugin as an alternative for coverage measuring and report generation. +* Offline instrumentation of class files. +* Instrumentation and report generation using Command Line Interface -## Quickstart +## Gradle Quickstart The recommended way of applying Kover is with the [plugins DSL](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block). +Minimum supported version of `Gradle` is `6.8`. + Add the following to your top-level build file:
@@ -50,6 +51,9 @@ plugins { ```
+After you applied Kover Gradle plugin, [Kover tasks](https://kotlin.github.io/kotlinx-kover/gradle-plugin#kover-tasks) will be created for generating reports and verification. +E.g. to generate HTML report for non-Android project run `./gradlew koverHtmlReport` - this will automatically start code compilation, execution of instrumented tests, and an HTML report will be generated with measurement results in the build folder. + #### Legacy Plugin Application [Legacy method](https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application) of applying plugins @@ -90,348 +94,10 @@ buildscript { apply plugin: 'kover' ``` - -## About Beta version -This is unstable test version of Kover Gradle Plugin with updated API. -Using this version is preferable in pet projects. - -Detailed documentation has not yet been completed. -Refer to [migration guide](docs/migration-to-0.7.0.md) in order to migrate from version `0.6.0` or `0.6.1`. - -## DSL -### The example of Kover configuration for Kotlin/JVM or Kotlin/MPP projects is given below - -```groovy -kover { - // disable() - - excludeJavaCode() - - useKoverTool() - - excludeInstrumentation { - classes("com.example.subpackage.*") - } - excludeTests { - tasks("myTest") - } -} - -koverReport { - // common filters for all reports - filters { - // exclusions for reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - - // configure default reports - for Kotlin/JVM or Kotlin/MPP projects or merged android variants - defaults { - // configure XML report - xml { - // generate an XML report when running the `check` task - onCheck = false - - // XML report file - setReportFile(layout.buildDirectory.file("my-project-report/result.xml")) - - // overriding filters only for the XML report - filters { - // exclusions for XML reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for XML reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - } - - // configure HTML report - html { - // custom header in HTML reports, project path by default - title = "My report title" - - // generate a HTML report when running the `check` task - onCheck = false - - // directory for HTML report - setReportDir(layout.buildDirectory.dir("my-project-report/html-result")) - - // overriding filters only for the HTML report - filters { - // exclusions for HTML reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for HTML reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - } - - // configure verification - verify { - // verify coverage when running the `check` task - onCheck = true - - // add verification rule - rule { - // check this rule during verification - isEnabled = true - - // specify the code unit for which coverage will be aggregated - entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION - - // overriding filters only for current rule - filters { - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - - // specify verification bound for this rule - bound { - // lower bound - minValue = 1 - - // upper bound - maxValue = 99 - - // specify which units to measure coverage for - metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE - - // specify an aggregating function to obtain a single value that will be checked against the lower and upper boundaries - aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE - } - - // add lower bound for percentage of covered lines - minBound(2) - - // add upper bound for percentage of covered lines - maxBound(98) - } - } - } -} -``` - -### Example for Kotlin + Android projects -```groovy -kover { - // disable() - - excludeJavaCode() - - useKoverTool() - - excludeInstrumentation { - classes("com.example.subpackage.*") - } - - excludeTests { - tasks("myTest") - } -} - -koverReport { - // common filters for all reports of all variants - filters { - // exclusions for reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - - defaults { - // add reports of 'release' Android build variant to default reports - generated by tasks `koverXmlReport`, `koverHtmlReport` etc - mergeWith("release") - } - - // configure report for `release` build variant (Build Type + Flavor) - generated by tasks `koverXmlReportRelease`, `koverHtmlReportRelease` etc - androidReports("release") { - // configure XML report for `release` build variant (task `koverXmlReportRelease`) - xml { - // generate an XML report when running the `check` task - onCheck = false - - // XML report file - setReportFile(layout.buildDirectory.file("my-project-report/result.xml")) - - // overriding filters only for the XML report - filters { - // exclusions for XML reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for XML reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - } - - // configure HTML report for `release` build variant (task `koverHtmlReportRelease`) - html { - // custom header in HTML reports, project path by default - title = "My report title" - - // generate a HTML report when running the `check` task - onCheck = false - - // directory for HTML report - setReportDir(layout.buildDirectory.dir("my-project-report/html-result")) - - // overriding filters only for the HTML report - filters { - // exclusions for HTML reports - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - - // inclusions for HTML reports - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - } - - // configure verification for `release` build variant (task `koverVerifyRelease`) - verify { - // verify coverage when running the `check` task - onCheck = true - - // add verification rule - rule { - // check this rule during verification - isEnabled = true - - // specify the code unit for which coverage will be aggregated - entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION - - // overriding filters only for current rule - filters { - excludes { - // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available - packages("com.another.subpackage") - // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available - annotatedBy("*Generated*") - } - includes { - // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available - classes("com.example.*") - // includes all classes located in specified package and it subpackages - packages("com.another.subpackage") - } - } - - // specify verification bound for this rule - bound { - // lower bound - minValue = 1 - - // upper bound - maxValue = 99 - - // specify which units to measure coverage for - metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE - - // specify an aggregating function to obtain a single value that will be checked against the lower and upper boundaries - aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE - } - - // add lower bound for percentage of covered lines - minBound(2) - - // add upper bound for percentage of covered lines - maxBound(98) - } - } - } -} -``` - -### To create report combining coverage info from different projects +### To create report combining coverage info from different Gradle projects You have to add dependency on the project, in which the report task will be run ```groovy dependencies { @@ -441,4 +107,9 @@ dependencies { in this case report will be generated for current project joined with `:another:project` project. -More examples can be found in [example folder](examples) +**More examples of Gradle plugin applying can be found in [example folder](examples)** + +## Building locally and Contributing + +See [Contributing Guidelines](https://github.com/Kotlin/kotlinx-kover/tree/main/CONTRIBUTING.md). + diff --git a/api/kover-gradle-plugin.api b/api/kover-gradle-plugin.api index 4762cfc6..6ee3e6d9 100644 --- a/api/kover-gradle-plugin.api +++ b/api/kover-gradle-plugin.api @@ -195,9 +195,8 @@ public abstract interface class kotlinx/kover/gradle/plugin/dsl/KoverProjectExte public fun instrumentation (Lkotlin/jvm/functions/Function1;)V public fun isDisabled ()Z public fun setEngine (Ljava/lang/Void;)V - public abstract fun useJacocoTool ()V - public abstract fun useJacocoTool (Ljava/lang/String;)V - public abstract fun useKoverTool ()V + public abstract fun useJacoco ()V + public abstract fun useJacoco (Ljava/lang/String;)V public fun verify (Lkotlin/jvm/functions/Function0;)V public fun xmlReport (Lkotlin/jvm/functions/Function0;)V } diff --git a/build.gradle.kts b/build.gradle.kts index 0f7025de..fe984d3c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -120,7 +120,7 @@ tasks.withType().configureEach { tasks.dokkaHtml { moduleName.set("Kover Gradle Plugin") - outputDirectory.set(layout.projectDirectory.dir("docs/dokka").asFile) + outputDirectory.set(layout.projectDirectory.dir("docs/gradle-plugin/dokka").asFile) dokkaSourceSets.configureEach { // source set configuration section perPackageOption { diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 00000000..6ebdc811 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,12 @@ +remote_theme: pages-themes/slate@v0.2.0 +lsi: false +safe: true +source: / +highlighter: rouge +incremental: false +gist: + noscript: false +kramdown: + input: GFM + hard_wrap: false + syntax_highlighter: rouge diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss new file mode 100644 index 00000000..ca15c991 --- /dev/null +++ b/docs/assets/css/style.scss @@ -0,0 +1,16 @@ +--- +--- + +@import "{{ site.theme }}"; +.inner{max-width:1280px;} +#project_title { + visibility: hidden; + position: relative; +} +#project_title:after { + visibility: visible; + position: absolute; + top: 0; + left: 0; + content: "Kover - Kotlin Coverage Tool"; +} diff --git a/docs/cli/index.md b/docs/cli/index.md new file mode 100644 index 00000000..a03a7e02 --- /dev/null +++ b/docs/cli/index.md @@ -0,0 +1,148 @@ +# Kover Command Line Interface + +This single jar artifact allows using some of the functionality of Kover Toolset through command-line calls. + +Java 1.6 or higher is required for execution. + +## Commands + +### Offline instrumentation + +For information about offline instrumentation, [see](#offline-instrumentation-1). + +`java -jar kover-cli.jar instrument [ ...] --dest [--exclude ] [--excludeAnnotation ] [--hits] [--include ]` + +| Option | Description | Required | Multiple | +|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------|:--------:|:--------:| +| `` | list of the compiled class-files roots | + | + | +| --dest | path to write instrumented Java classes to | + | | +| --exclude | filter to exclude classes from instrumentation, wildcards `*` and `?` are acceptable. Excludes have priority over includes | | + | +| --excludeAnnotation | filter to exclude annotated classes from instrumentation, wildcards `*` and `?` are acceptable | | + | +| --hits | a flag to enable line hits counting | | | +| --include | instrument only specified classes, wildcards `*` and `?` are acceptable | | + | + +### Generating reports +Allows you to generate HTML and XML reports from the existing binary report. + +`java -jar kover-cli.jar report [ ...] --classfiles [--exclude ] [--excludeAnnotation ] [--html ] [--include ] --src [--title ] [--xml ]` + +| Option | Description | Required | Multiple | +|---------------------------------------|---------------------------------------------------------------------------------------------------------|:--------:|:--------:| +| `` | list of binary reports files | | + | +| --classfiles | location of the compiled class-files root (must be original and not instrumented) | + | + | +| --exclude | filter to exclude classes, wildcards `*` and `?` are acceptable | | + | +| --excludeAnnotation | filter to exclude classes and functions marked by this annotation, wildcards `*` and `?` are acceptable | | + | +| --html | generate a HTML report in the specified path | | | +| --include | filter to include classes, wildcards `*` and `?` are acceptable | | + | +| --src | location of the source files root | + | + | +| --title | title in the HTML report | | | +| --xml | generate a XML report in the specified path | | | + +## Offline instrumentation + +Offline instrumentation is suitable when using runtime environments that do not support Java agents. +It instruments the files located in the file system and saves the result to the specified directory. + +To run classes instrumented offline, you need to add `org.jetbrains.kotlinx:kover-offline` artifact to the application's classpath. + +You also need to pass the system property `kover.offline.report.path` to the application with the path where you want binary report to be saved. + +Also see [Gradle example](#gradle-example) + +## Examples + +### Gradle example +Example of custom using Kover tool CLI in Gradle +``` +plugins { + kotlin("jvm") version "1.8.0" + application +} + +repositories { + mavenCentral() +} + +configurations.register("koverCli") { + isVisible = false + isCanBeConsumed = false + isTransitive = true + isCanBeResolved = true +} + +dependencies { + runtimeOnly("org.jetbrains.kotlinx:kover-offline-runtime:0.7.0-Beta") + add("koverCli", "org.jetbrains.kotlinx:kover-cli:0.7.0-Beta") + + testImplementation(kotlin("test")) +} + +tasks.test { + useJUnitPlatform() +} + +kotlin { + jvmToolchain(11) +} + +fun cliJar(): File { + val cliConfig = configurations.getByName("koverCli") + return cliConfig.filter {it.name.startsWith("kover-cli")}.singleFile +} + +tasks.compileKotlin { + doLast { + val outputDir = destinationDirectory.get().asFile + + exec { + commandLine( + "java", + "-jar", + cliJar().canonicalPath, + "instrument", + outputDir, + "--dest", + outputDir, + "--hits", + ) + } + } +} + +val binaryReport = layout.buildDirectory.file("kover/report.ic").get().asFile + +tasks.test { + // set system property for binary report path + systemProperty("kover.offline.report.path", binaryReport.absolutePath) +} + +tasks.register("koverReport") { + dependsOn(tasks.test) + + doLast { + val args = mutableListOf() + + args += "java" + args += "-jar" + args += cliJar().canonicalPath + args += "report" + args += binaryReport.absolutePath + args += "--classfiles" + args += tasks.compileKotlin.get().destinationDirectory.get().asFile.absolutePath + args += "--classfiles" + args += tasks.compileJava.get().destinationDirectory.get().asFile.absolutePath + args += "--xml" + args += layout.buildDirectory.file("reports/kover/report.xml").get().asFile.absolutePath + args += "--html" + args += layout.buildDirectory.file("reports/kover/html").get().asFile.absolutePath + + sourceSets.main.get().kotlin.sourceDirectories.files.forEach { src -> + args += "--src" + args += src.canonicalPath + } + + exec { commandLine(args) } + } +} + +``` diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/index.html deleted file mode 100644 index 956cdee8..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - KoverAndroidExtension - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverAndroidExtension

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun common(config: Action<KoverGeneralAndroidReport>)
-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun report(buildVariantName: String, config: Action<KoverReportExtension>)
-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/report.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/report.html deleted file mode 100644 index 9c6f115d..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/report.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - report - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

report

-
-
abstract fun report(buildVariantName: String, config: Action<KoverReportExtension>)
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/html.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/html.html deleted file mode 100644 index 1c156f19..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/html.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - html - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

html

-
-
abstract fun html(config: Action<KoverGeneralHtmlReportConfig>)

Configure HTML report for all Android build variants.

html {
filters {
// ...
}

title = "My report title"
}
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/verify.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/verify.html deleted file mode 100644 index 13ea5323..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/verify.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - verify - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

verify

-
-
abstract fun verify(config: Action<KoverGeneralVerifyReportConfig>)

Configure coverage verification for all Android build variants..

verify {
rule {
// ...
}

rule("Custom Name") {
// ...
}
}
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/xml.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/xml.html deleted file mode 100644 index a8f47e49..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/xml.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - xml - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

xml

-
-
abstract fun xml(config: Action<KoverGeneralXmlReportConfig>)

Configure HTML report for all Android build variants.

xml {
filters {
// ...
}
}
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config/index.html deleted file mode 100644 index 338b2513..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-html-report-config/index.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - KoverGeneralHtmlReportConfig - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverGeneralHtmlReportConfig

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun filters(config: Action<KoverReportFilters>)

Override common filters only for HTML report.

-
-
-
-
-
-
-
-

Properties

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract var title: String?

Specify header in HTML reports.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-verify-report-config/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-verify-report-config/index.html deleted file mode 100644 index 7345c402..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-verify-report-config/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - KoverGeneralVerifyReportConfig - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverGeneralVerifyReportConfig

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun rule(config: Action<KoverVerifyRule>)

Add new coverage verification rule to check after test task execution.

abstract fun rule(name: String, config: Action<KoverVerifyRule>)

Add new named coverage verification rule to check after test task execution.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-xml-report-config/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-xml-report-config/index.html deleted file mode 100644 index e36df42c..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-xml-report-config/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - KoverGeneralXmlReportConfig - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverGeneralXmlReportConfig

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun filters(config: Action<KoverReportFilters>)

Override common filters only for XML report.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-jvm-source-set/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-jvm-source-set/index.html deleted file mode 100644 index 57dd3fa0..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-jvm-source-set/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - KoverJvmSourceSet - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverJvmSourceSet

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun sourceSetName(vararg name: String)
abstract fun sourceSetName(names: Iterable<String>)

Exclude specified source sets from report.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/compilation.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/compilation.html deleted file mode 100644 index ed50dd24..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/compilation.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - compilation - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

compilation

-
-
abstract fun compilation(targetName: String, compilationName: String)

Exclude sources of specified Kotlin compilations from Kotlin MPP reports.

As a side effect, reports cease to depend on the task of compiling specified compilations.


abstract fun compilation(compilationName: String)

Exclude sources of all Kotlin compilations with specified name from Kotlin MPP reports.

As a side effect, reports cease to depend on the task of compiling specified compilations.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/index.html deleted file mode 100644 index 996e9f45..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - KoverMppSourceSet - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverMppSourceSet

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun compilation(compilationName: String)

Exclude sources of all Kotlin compilations with specified name from Kotlin MPP reports.

abstract fun compilation(targetName: String, compilationName: String)

Exclude sources of specified Kotlin compilations from Kotlin MPP reports.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun targetName(vararg name: String)

Exclude sources of specified targets from Kotlin MPP reports.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/target-name.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/target-name.html deleted file mode 100644 index f0a5d507..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-mpp-source-set/target-name.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - targetName - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

targetName

-
-
abstract fun targetName(vararg name: String)

Exclude sources of specified targets from Kotlin MPP reports.

As a side effect, reports cease to depend on the task of compiling specified targets.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-r-e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-r-e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html deleted file mode 100644 index 3e6fcc26..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-names/-r-e-g-u-l-a-r_-r-e-p-o-r-t_-e-x-t-e-n-s-i-o-n_-n-a-m-e.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - REGULAR_REPORT_EXTENSION_NAME - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

REGULAR_REPORT_EXTENSION_NAME

-
-

Name of the project extension to configure Kover reports for Kotlin JVM and Kotlin Multiplatform projects.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-sources.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-sources.html deleted file mode 100644 index b58eaa42..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-project-extension/exclude-sources.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - excludeSources - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

excludeSources

-
-
abstract fun excludeSources(config: Action<KoverSourcesExclusions>)

Experimental

Exclude specified compilation units from report.

The unit is typical for each type of project, for example, for Kotlin JVM it is Source Set, for Kotlin MPP it is target or Kotlin compilation. Also, JVM sources are an independent compilation unit.

As a side effect, when any compilation unit is excluded, reports cease to depend on the task of compiling this unit.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/index.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/index.html deleted file mode 100644 index d839b945..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/index.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - KoverSourcesExclusions - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KoverSourcesExclusions

- -
-
-
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun jvm(config: Action<KoverJvmSourceSet>)

Specify compilation unit exclusion for Kotlin JVM project.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract fun mpp(config: Action<KoverMppSourceSet>)

Specify compilation unit exclusion for Kotlin MPP project.

-
-
-
-
-
-
-
-

Properties

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
abstract var excludeJavaCode: Boolean

Excludes form report all classes, defined in Java sources.

-
-
-
-
-
-
-
-
-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/jvm.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/jvm.html deleted file mode 100644 index 017c243c..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/jvm.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - jvm - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

jvm

-
-
abstract fun jvm(config: Action<KoverJvmSourceSet>)

Specify compilation unit exclusion for Kotlin JVM project.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/mpp.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/mpp.html deleted file mode 100644 index 3125a7a2..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-sources-exclusions/mpp.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - mpp - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

mpp

-
-
abstract fun mpp(config: Action<KoverMppSourceSet>)

Specify compilation unit exclusion for Kotlin MPP project.

-
- -
-
- - diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-m-i-n-i-m-a-l_-v-e-r-s-i-o-n.html b/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-m-i-n-i-m-a-l_-v-e-r-s-i-o-n.html deleted file mode 100644 index bf2e4caa..00000000 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-versions/-k-o-v-e-r_-t-o-o-l_-m-i-n-i-m-a-l_-v-e-r-s-i-o-n.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - KOVER_TOOL_MINIMAL_VERSION - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-

KOVER_TOOL_MINIMAL_VERSION

-
-

Minimal supported Kover coverage tool version.

-
- -
-
- - diff --git a/docs/gradle-plugin/configuring.md b/docs/gradle-plugin/configuring.md new file mode 100644 index 00000000..65245ca5 --- /dev/null +++ b/docs/gradle-plugin/configuring.md @@ -0,0 +1,433 @@ +# Configuring the Kover plugin +- [Configuring default reports](#configuring-default-reports) +- [Configuring Android reports](#configuring-android-reports) +- [Reports filtering](#reports-filtering) +- [Class name with wildcards](#class-name-with-wildcards) +- [Verification](#verification) +- [Merging reports](#merging-reports) + + +## Configuring default reports + +The full configuration for default reports is given below. +These reports are avialable by default when Kover is applied by tasks such as `:koverHtmlReport` and `:koverXmlReport`. + +See also [verification explanations](#verification) + +```kotlin +koverReport { + // configure default reports - for Kotlin/JVM or Kotlin/MPP projects or merged android variants + defaults { + // filters for all default reports + filters { + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + } + } + + // configure XML report + xml { + // generate an XML report when running the `check` task + onCheck = false + + // XML report file + setReportFile(layout.buildDirectory.file("my-project-report/result.xml")) + + // overriding filters only for the XML report + filters { + // exclusions for XML reports + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + + // inclusions for XML reports + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + } + + // configure HTML report + html { + // custom header in HTML reports, project path by default + title = "My report title" + + // custom charset in HTML report files, used return value of `Charset.defaultCharset()` for Kover or UTF-8 for JaCoCo by default. + charset = "UTF-8" + + // generate a HTML report when running the `check` task + onCheck = false + + // directory for HTML report + setReportDir(layout.buildDirectory.dir("my-project-report/html-result")) + + // overriding filters only for the HTML report + filters { + // exclusions for HTML reports + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + + // inclusions for HTML reports + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + } + + // configure verification + verify { + // verify coverage when running the `check` task + onCheck = true + + // add verification rule + rule { + // check this rule during verification + isEnabled = true + + // specify the code unit for which coverage will be aggregated + entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION + + // overriding filters only for current rule + filters { + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + + // specify verification bound for this rule + bound { + // lower bound + minValue = 1 + + // upper bound + maxValue = 99 + + // specify which units to measure coverage for + metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE + + // specify an aggregating function to obtain a single value that will be checked against the lower and upper boundaries + aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE + } + + // add lower bound for percentage of covered lines + minBound(2) + + // add upper bound for percentage of covered lines + maxBound(98) + } + } + } +} +``` + +## Configuring Android reports + +The full configuration for Android reports for `release` build variant is given below. + +See also [verification explanations](#verification) + +```kotlin +koverReport { + // configure report for `release` build variant (Build Type + Flavor) - generated by tasks `koverXmlReportRelease`, `koverHtmlReportRelease` etc + androidReports("release") { + // filters for all reports of `release` build variant + filters { + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + } + } + + // configure XML report for `release` build variant (task `koverXmlReportRelease`) + xml { + // generate an XML report when running the `check` task + onCheck = false + + // XML report file + setReportFile(layout.buildDirectory.file("my-project-report/result.xml")) + + // overriding filters only for the XML report + filters { + // exclusions for XML reports + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + + // inclusions for XML reports + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + } + + // configure HTML report for `release` build variant (task `koverHtmlReportRelease`) + html { + // custom header in HTML reports, project path by default + title = "My report title" + + // custom charset in HTML report files, used return value of `Charset.defaultCharset()` for Kover or UTF-8 for JaCoCo by default. + charset = "UTF-8" + + // generate a HTML report when running the `check` task + onCheck = false + + // directory for HTML report + setReportDir(layout.buildDirectory.dir("my-project-report/html-result")) + + // overriding filters only for the HTML report + filters { + // exclusions for HTML reports + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + + // inclusions for HTML reports + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + } + + // configure verification for `release` build variant (task `koverVerifyRelease`) + verify { + // verify coverage when running the `check` task + onCheck = true + + // add verification rule + rule { + // check this rule during verification + isEnabled = true + + // specify the code unit for which coverage will be aggregated + entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION + + // overriding filters only for current rule + filters { + excludes { + // excludes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // excludes all classes located in specified package and it subpackages, wildcards '*' and '?' are available + packages("com.another.subpackage") + // excludes all classes and functions, annotated by specified annotations, wildcards '*' and '?' are available + annotatedBy("*Generated*") + } + includes { + // includes class by fully-qualified JVM class name, wildcards '*' and '?' are available + classes("com.example.*") + // includes all classes located in specified package and it subpackages + packages("com.another.subpackage") + } + } + + // specify verification bound for this rule + bound { + // lower bound + minValue = 1 + + // upper bound + maxValue = 99 + + // specify which units to measure coverage for + metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE + + // specify an aggregating function to obtain a single value that will be checked against the lower and upper boundaries + aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE + } + + // add lower bound for percentage of covered lines + minBound(2) + + // add upper bound for percentage of covered lines + maxBound(98) + } + } + } +} +``` + +## Reports filtering +Report filtering is used to exclude one or more classes from the report, and so that they are not taken into account during verification. + +Filters consist of inclusion and exclusion rules. +Exclusion rules are names of the classes that must be excluded from the report. Inclusion rules are the classes that should be included in the report, all other classes are excluded from the report. + +If inclusion and exclusion rules are specified at the same time, then excludes have priority over includes. +This means that even if a class is specified in both the inclusion and exclusion rules, it will be excluded from the report (e.g. class `com.example.Class1` above). + +[Wildcards](#class-name-with-wildcards) `*` and `?` are allowed in class names. + +There are several levels where you can define filters. Each of the levels has its own priority. +```kotlin + +koverReport { + // common filters for all reports + filters { + excludes { + // exclusions for all reports + } + includes { + // inclusions for all reports + } + } + + defaults { + // overriding filters for default reports + filters { + excludes { + // exclusions for default reports + } + includes { + // inclusions for default reports + } + } + + xml { + // overriding filters for default xml report + filters { + excludes { } + includes { } + } + } + } + androidReports("release") { + // overriding filters for reports for `release` build variant + filters { + excludes { + // exclusions for reports for `release` build variant + } + includes { + // inclusions for default reports for `release` build variant + } + } + + xml { + // overriding filters for xml report for `release` build variant + filters { + excludes { } + includes { } + } + } + } +} +``` + +Filter definition levels in ascending order of priority: +- common level - applies to all Kover reports in the current project +- variant level - used for Kover reports for default tasks or some Android build variant +- report level - specifies the xml or html filters of the report, or verification, for the default variant or Android build variant +- verification rule level - applies only to one specific verification rule + +If a higher priority filter is specified, it completely replaces the rules written by the level above. +By specifying an empty filter `filters { }`, you can completely disable report filtering. + +## Class name with wildcards + +Inclusion/exclusion value rules: + +* Should be a fully-qualified class name. +* Can contain wildcards: + * `*` for zero or more of any char. + * `**` is the same as `*`. + * `?` for one of any char. +* File and directory names are not allowed. + +Examples: + +* (good) `my.package.ClassName` +* (good) `my.*.*Name` +* (bad) `my/package/ClassName.kt` +* (bad) `src/my.**.ClassName` + +## Verification +When checking a certain verification rule, the entire code is divided into units of code for which it determines whether it was covered (executed) or skipped (not executed). +For example, an entire line from source code or a specific JVM instruction from compiled byte-code can be executed or not. + +All units are grouped into one or more groups. +Based on amount of the executed and non-executed code units, one number (current value) will be calculated for each group using the aggregation function. + +It is this current value of the group that will be compared with the minimum and maximum boundaries specified in the configuration. + +Type `MetricType` determines for which types of units the coverage will be measured. +It is: + - `LINE` + - `INSTRUCTION` + - `BRANCH` + +For comparison with the specified boundaries, the number of covered (executed) or skipped (not executed) units should be aggregated into one number. +`AggregationType` determines exactly how the current measurement value will be calculated: +- `COVERED_COUNT` - the total number of units of code that were executed +- `MISSED_COUNT` - the total number of units of code that were not executed +- `COVERED_PERCENTAGE` - is the number of covered units divided by the number of all units and multiplied by 100 +- `MISSED_PERCENTAGE` - is the number of uncovered units divided by the number of all units and multiplied by 100 + +To calculate the current value, units are grouped by various entities. +By default, all application units of code are grouped by a single application entity, so one current value is calculated for the entire application using the aggregating function. + +But you can group code units by other named entities. +The `GroupingEntityType` type is used for this: +- `APPLICATION` - one current coverage value for the entire application will be calculated +- `CLASS` - the current value will be calculated individually for each class. So the bounds will be checked for each class +- `PACKAGE` - the current value will be calculated individually for all classes in each package. So the bounds will be checked for each package + +## Merging reports +If it is necessary to generate a report for a specific build variant using the Kover default report tasks, it is possible to combine the contents of the Android report and the default report. + +This is done by configuring default reports +``` +koverReport { + defaults { + mergeWith("release") + } +} +``` +This will add the reports contents of `release` Android build variant to default reports. + +This can be useful if only one command is run in a multimodule project for uniformity, instead of many different ones for each module. +Or if in a multiplatform project it is necessary to generate a single report for JVM and Android targets. + +**If the report for the build variant was added to the default report, the measurements for this variant are exported and will be used in dependencies.** diff --git a/docs/development/functionalTests.md b/docs/gradle-plugin/development/functionalTests.md similarity index 100% rename from docs/development/functionalTests.md rename to docs/gradle-plugin/development/functionalTests.md diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-c-o-u-n-t/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-c-o-u-n-t/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-c-o-u-n-t/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-c-o-u-n-t/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-p-e-r-c-e-n-t-a-g-e/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-p-e-r-c-e-n-t-a-g-e/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-p-e-r-c-e-n-t-a-g-e/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-c-o-v-e-r-e-d_-p-e-r-c-e-n-t-a-g-e/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-c-o-u-n-t/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-c-o-u-n-t/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-c-o-u-n-t/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-c-o-u-n-t/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-p-e-r-c-e-n-t-a-g-e/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-p-e-r-c-e-n-t-a-g-e/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-p-e-r-c-e-n-t-a-g-e/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/-m-i-s-s-e-d_-p-e-r-c-e-n-t-a-g-e/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/is-percentage.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/is-percentage.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/is-percentage.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/is-percentage.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/value-of.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/value-of.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/value-of.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/value-of.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/values.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/values.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/values.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-aggregation-type/values.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-a-p-p-l-i-c-a-t-i-o-n/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-a-p-p-l-i-c-a-t-i-o-n/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-a-p-p-l-i-c-a-t-i-o-n/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-a-p-p-l-i-c-a-t-i-o-n/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-c-l-a-s-s/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-c-l-a-s-s/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-c-l-a-s-s/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-c-l-a-s-s/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-p-a-c-k-a-g-e/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-p-a-c-k-a-g-e/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-p-a-c-k-a-g-e/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/-p-a-c-k-a-g-e/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/value-of.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/value-of.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/value-of.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/value-of.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/values.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/values.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/values.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-grouping-entity-type/values.html diff --git a/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/index.html new file mode 100644 index 00000000..894aff78 --- /dev/null +++ b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/index.html @@ -0,0 +1,156 @@ + + + + + KoverDefaultReportsConfig + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

KoverDefaultReportsConfig

+

Configuration for default variant reports

+
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
abstract fun filters(config: Action<KoverReportFilters>)

Specify common filters for the current report context, these filters will be inherited in HTML/XML/verification reports. They can be redefined in the settings of a specific report.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
abstract fun html(config: Action<KoverHtmlReportConfig>)

Configure HTML report for current report context.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
abstract fun mergeWith(otherVariant: String)

Add the contents of the reports with specified variant to the default reports.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
abstract fun verify(config: Action<KoverVerifyReportConfig>)

Configure coverage verification for current report context.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
abstract fun xml(config: Action<KoverXmlReportConfig>)

Configure HTML report for current report context.

+
+
+
+
+
+
+
+
+
+ +
+
+ + diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/common.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/merge-with.html similarity index 79% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/common.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/merge-with.html index f0564491..d50ead87 100644 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-android-extension/common.html +++ b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-default-reports-config/merge-with.html @@ -2,7 +2,7 @@ - common + mergeWith + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

defaults

+
+
abstract fun defaults(config: Action<KoverDefaultReportsConfig>)

Configure reports for classes from Kotlin/JVM or Kotlin/MPP projects. Also content from specified Android build variant can be added by calling mergeWith.

example:

kover {
defaults {
// add content of reports for specified variant to default reports
mergeWith("buildVariant")

filters {
// override report filters for default reports
}

html {
// configure default HTML report
}

xml {
// configure default XML report
}

verify {
// configure default coverage verification
}
}
}
+
+ +
+
+ + diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/filters.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/filters.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/filters.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/filters.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-extension/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/annotated-by.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/annotated-by.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/annotated-by.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/annotated-by.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/classes.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/classes.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/classes.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/classes.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/packages.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/packages.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/packages.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filter/packages.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/excludes.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/excludes.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/excludes.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/excludes.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/includes.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/includes.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/includes.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/includes.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/index.html similarity index 100% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-report-filters/index.html diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/filters.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/filters.html similarity index 82% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/filters.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/filters.html index 31021d30..edcadb9e 100644 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/filters.html +++ b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/filters.html @@ -54,12 +54,12 @@
-
- +
+

filters

-
abstract fun filters(config: Action<KoverReportFilters>)

Specify common filters for all Android build variants, these filters will be inherited in HTML/XML/verification reports in any variant. They can be redefined in the settings of a specific report of specific build variant.

filters {
excludes {
// ...
}

includes {
// ...
}
}
+
abstract fun filters(config: Action<KoverReportFilters>)

Specify common filters for the current report context, these filters will be inherited in HTML/XML/verification reports. They can be redefined in the settings of a specific report.

filters {
excludes {
// ...
}

includes {
// ...
}
}
-
- +
+

html

diff --git a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/index.html b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/index.html similarity index 76% rename from docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/index.html rename to docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/index.html index 3701232e..2911aef7 100644 --- a/docs/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-general-android-report/index.html +++ b/docs/gradle-plugin/dokka/-kover -gradle -plugin/kotlinx.kover.gradle.plugin.dsl/-kover-reports-config/index.html @@ -2,7 +2,7 @@ - KoverGeneralAndroidReport + KoverReportsConfig