Skip to content
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

Pass list of projects via all projects filter #575

Closed
igorromcy opened this issue Mar 21, 2024 · 4 comments
Closed

Pass list of projects via all projects filter #575

igorromcy opened this issue Mar 21, 2024 · 4 comments
Assignees
Labels
Question Support request issue type S: untriaged Status: issue reported but unprocessed

Comments

@igorromcy
Copy link

I'm trying to use all projects with a filter

allProjects(filter: Spec<Project>)

but I didn't understand via the documentation how I should achieve that, so far I have a list of strings with all projects (i.e: ":feature:login", ":feature:signup", etc..)

@igorromcy igorromcy added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 21, 2024
@shanshin
Copy link
Collaborator

Hi, to merge all projects you shouldn't specify filter, like this

            kover {
                merge {
                    // merge with all projects
                    allProjects()

                   // other configs
                }
            }

@igorromcy
Copy link
Author

sorry I wasn't clear, I need to use that filter, so I'm trying to convert the list of strings (modules) to that Spec

I just found out that we have projects(vararg projectNameOrPath: String) available to use as a filter as well, let me try that.

@shanshin
Copy link
Collaborator

Yes, projects(...) is intended for cases when there is only a list with the names of projects that should be merged.

But you can also use allProjects if you specify a predicate in the form of a lambda expression:

kover {
    merge {
        allProjects {
            it.path in setOf(":feature:login", ":feature:signup") // or for Groovy  [":feature:login", ":feature:signup"]
        }
    }
}

@igorromcy
Copy link
Author

Perfect! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

No branches or pull requests

2 participants