-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can App module include kover(project(":lib"))
for a large number of sub-modules?
#594
Comments
Hi,
you can use the functions to iterate through the projects in the build like
*at the same time, it is important that the Kover plugin is applied in all projects that will be used in
This approach is recommended: you select one specific project in which the task of generating the merged report will be located. We will call such a project a merging project. For example, you decided that
if you do not specify the If your build consists of mixed Kotlin and Android projects, then I recommend trying to use the |
Such multi-project builds are very useful for obtaining use-cases of using the Kover plugin. And so they were added recursively, e.g. : |
hi @shanshin. Here is my feedback to your question above, since a have a similar usecase.
In my opinion this would be very useful. We currently need one merged report that we can pass to sonarqube. I can't think of a project where i would exclude modules which are implemented. This feature would furthermore solve one problem of mine. We have a multi-module project which results in a few different apps. Depending on the buildvariant different modules are implemented. When using allprojects without any sort of filtering based on the buildvariant this results on too many modules in the report for that specific app. Furthermore the described idea using I currently use the following workaround:
I then iterate over this list inside :app's dependency block and do Do you have any other suggestions which feel less like an hacky workaround? ;) |
@trietbui85, @woodii, sorry for delayed answer, apparently, I missed the question. We are currently working on the potential transfer of code coverage measurement to the Kotlin Gradle Plugin. So far, a prototype has been implemented, which is testing a different approach to collecting coverage. You can apply the plugin by specifying in the plugins {
id("org.jetbrains.kotlinx.kover.aggregation") version "0.8.2"
} There is no need to apply it anywhere else, all uses of the This aggregation plugin works differently. Report generation tasks are created only in the root project, settings are made only in the To instrument the tests, you need to enable coverage measurement, this can be done by adding the CLI argument kover {
enableCoverage() The key difference is that running the In order not to restart tests in different builds, use the build cache. |
Closed as answered |
Describe what you would like to clarify about Kover
My project is multi modules, multi flavors, with the following structure
(My real project has more than 200 sub-modules)
App
depends on all Feature modules, but not Core module. Therefore, its build.gradle with Kover block would be:So, my question:
kover(project(":feature:xxx"))
? I don't think we should call it up to 100 times to include all Feature modules.kover(project(":core:xxx"))
for Core modules? Or should it callkover(project(":core:xxx"))
in the Feature module instead?kover(project(":feature:xxx"))
in App module? I still see the coverage report, but is it the coverage of all modules in project, or just App module? 🤔The text was updated successfully, but these errors were encountered: