Hi Question about the Jacoco aggregator plugin: ...
# community-support
j
Hi Question about the Jacoco aggregator plugin: I have a project with multiple subprojects. On the CI, I am running the test and Jacoco report on each. I would like to aggregate the results into a single report. Maybe I am missing something, but in the documentation, both the distribution and the dedicated subproject solution assume a dependency between the subprojects. This is not my case, and I don’t want to create a dedicated subproject and add a dependency each time a new subproject is created. Any other solution? In the end, my CI provider (Azure DevOps pipeline) expects 1 HTML, and when I try to use file regex, it takes the last one it finds.
v
I don’t want to create a dedicated subproject and add a dependency each time a new subproject is created
Is the first part the problem or mainly the second?
j
Mainly the second
Users will not know they will have to add this and as the project will grow it will be really hard to maintain
v
Copy code
dependencies {
    rootProject.allProjects.forEach {
        jacocoAggregation(it)
    } 
}
j
Thanks @Vampire Can I just declare this in the root build cradle file? Or I still have to create the dedicated subproject?
v
Whereever you want to create the aggregate report. That the projects you depend on directly or transitively are only included is just the default. As its docs say, you can always customize using
jacocoAggregation
configuration which projects should be aggregated.
j
Thanks a lot
Last question - the same goes for the test aggregation plugin right?
v
I think so