Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azizutku/jacoco-aggregate-coverage-plugin
Unified JaCoCo Code Coverage Plugin for Multi Module Projects
https://github.com/azizutku/jacoco-aggregate-coverage-plugin
aggregated-test-coverage aggregation android code-coverage coverage jacoco kotlin multi-module report test-coverage unified-report unified-test-coverage
Last synced: 9 days ago
JSON representation
Unified JaCoCo Code Coverage Plugin for Multi Module Projects
- Host: GitHub
- URL: https://github.com/azizutku/jacoco-aggregate-coverage-plugin
- Owner: azizutku
- License: other
- Created: 2023-11-01T16:29:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-20T11:07:23.000Z (10 months ago)
- Last Synced: 2024-08-02T19:36:45.179Z (4 months ago)
- Topics: aggregated-test-coverage, aggregation, android, code-coverage, coverage, jacoco, kotlin, multi-module, report, test-coverage, unified-report, unified-test-coverage
- Language: JavaScript
- Homepage:
- Size: 235 KB
- Stars: 33
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - azizutku/jacoco-aggregate-coverage-plugin - Unified JaCoCo Code Coverage Plugin for Multi Module Projects (JavaScript)
README
[![Android Weekly #604](https://androidweekly.net/issues/issue-604/badge)](https://androidweekly.net/issues/issue-604)
[![Kotlin Weekly #388](https://img.shields.io/badge/Featured%20in%20kotlinweekly.net-Issue%20%23388-orange)](https://mailchi.mp/kotlinweekly/kotlin-weekly-388)## JaCoCo Aggregate Coverage Plugin
The plugin streamlines the generation of a unified code coverage report across multi-module Android projects. It collects and combines coverage data generated by [JaCoCo](https://github.com/jacoco/jacoco) from all subprojects, providing a detailed and comprehensive view of your project's test coverage.## Features
- Aggregates JaCoCo coverage reports from multiple modules.
- Generates a unified report for overall test coverage visualization.
- Ideal for multi-module Android projects.
- Easy to apply.> Note: This plugin does not configure the JaCoCo plugin automatically. You must configure the JaCoCo plugin manually within your project. The JaCoCo Aggregate Coverage Plugin requires the JaCoCo report task to be set up since it utilizes these tasks to aggregate reports.
# 1) Getting started
Integrate the JaCoCo Aggregate Coverage Plugin into your project with these steps:### Step 1: Update the root `build.gradle[.kts]` file
In your root `build.gradle[.kts]` file, add the following plugin configuration:```gradle
plugins {
...
id "com.azizutku.jacocoaggregatecoverageplugin" version "[write the latest version]" apply true
}
```### Step 2: Configure the plugin in the root `build.gradle[.kts]` file
```kotlin
jacocoAggregateCoverage {
jacocoTestReportTask.set("YOUR_JACOCO_TEST_REPORT_TASK")
// Other optional configurations
}
```# 2) Usage
After applying and configuring the plugin, you can generate the aggregated report by running the following command:```bash
./gradlew aggregateJacocoReports
```
The unified report will be generated at **`build/reports/jacocoAggregated/index.html`** in the root project.# Configuration
Configure the plugin in your root-level `build.gradle[.kts]` file:
```kotlin
jacocoAggregateCoverage {
jacocoTestReportTask.set("jacocoTestDebugUnitTestReport")
// Add the report directory only if you have a custom directory set
configuredCustomReportsDirectory.set("customJacocoReportDir")
// Specify the HTML output location if you have a custom one
configuredCustomHtmlOutputLocation.set("jacocoCustomHtmlFolder")
}
```
- **jacocoTestReportTask**: Required. Specify the task used to generate the JaCoCo report.
- **configuredCustomReportsDirectory**: Optional. Set this if you have a custom reports directory.
- **configuredCustomHtmlOutputLocation**: Optional. Set this if you have a custom directory for the HTML report output.## Example Aggregated Report
![Example Aggregated Report](images/example_aggregated_report.png)# Contribution
Contributions are welcome! Please feel free to submit a pull request or open an issue on the GitHub repository.# License
This project is licensed under the MIT License, allowing modification, distribution, and use in your own projects. Additionally, it incorporates resources and code from JaCoCo, which is covered by the Eclipse Public License v2.0. For detailed license terms, please refer to the [LICENSE](https://github.com/azizutku/jacoco-aggregate-coverage-plugin/blob/main/LICENSE) file.