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

How to disable the plugin for certain submodule? #117

Open
vsadokhin opened this issue Jul 22, 2016 · 2 comments
Open

How to disable the plugin for certain submodule? #117

vsadokhin opened this issue Jul 22, 2016 · 2 comments

Comments

@vsadokhin
Copy link

We have enabled gradle cobertura plugin for all submodules currently. Few of them don't need coverage check. We use coverageExcludes option to make the plugin not to care.
cobertura { coverageExcludes = [ '.*' ] }

Is there a better way just to disable the plugin in a submodule gradle config?

Thanks in advance!

@stevesaliman
Copy link
Owner

Sorry for the long delay in responding...

Are you enabling the plugin with a allprojects or subprojects block? If so, you can filter the projects so that they are not applied to the ones you want to exclude. For example:

subprojects {
    if ( !it.name == "excludedModule" ) {
     apply plugin: 'net.saliman.cobertura'
    }
}

This can be as simple or as complex as you need. For example, you could create an array of subproject names you want to exclude, and the if statement could see if the current project is in that array.

@vsadokhin
Copy link
Author

Hello Steve. We use subprojects. Thank you for your advise, I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants