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

Could you elaborate more on how to create a Provider in order to lazily provide exclusions? #556

Closed
nuhkoca opened this issue Feb 29, 2024 · 2 comments
Assignees
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed

Comments

@nuhkoca
Copy link
Contributor

nuhkoca commented Feb 29, 2024

Hello,

I came across the new migration guide for the version 0.8.0 and Lazy configuration section caught my attention as I use conventional plugins in our project and would like to more about how to create a Provider for exclusions e.g. how to create classProvider for a comma separated string exclusion?

kover {
  reports {
    filters {
      exludes {
         classes(classProvider) 
      }
    }
  }
}
@nuhkoca nuhkoca added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Feb 29, 2024
@shanshin
Copy link
Collaborator

Hi,
according to Gradle's recommendations, you should avoid explicitly creating Provider instance.

if you use convention plugin, then you need to declare the extension in it with property of type Propety<String>, like

interface MyExtension {
    //  comma separated string exclusion
    val exclusions: Property<String>
}

below, when configuring Kover from a comma-separated single string, you need to get Provider of a collection of strings, like

kover {
    reports {
        filters {
            exludes {
                classes(myExtension.exclusions.map { it.split(",") }) 
            }
        }
    }
}

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Mar 13, 2024
@shanshin
Copy link
Collaborator

Closed as answered.
Feel free to create new issue if you have any additional questions.

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: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants