Quality plugin configuration. Available as 'quality' closure.
| Type | Name and description |
|---|---|
java.lang.String |
animalsnifferVersionSets AnimalSniffer version. |
boolean |
autoRegistrationAutomatically register quality plugins, based on configured (affected) sources (sourceSets). |
boolean |
checkstyleEnable Checkstyle plugin. |
java.lang.String |
checkstyleVersion |
boolean |
codenarcEnable CodeNarc plugin. |
java.lang.String |
codenarcVersion |
java.lang.String |
configDirConfiguration files directory. |
boolean |
consoleReportingWhen false, disables reporting quality issues to console. |
boolean |
enabledWhen false, disables quality tasks execution. |
java.util.Collection<java.lang.String> |
excludeSource patterns (relative to source dir) to exclude from checks. |
org.gradle.api.file.FileCollection |
excludeSourcesDirect sources to exclude from checks (except animalsniffer). |
boolean |
findbugsEnable FindBugs plugin. |
java.lang.String |
findbugsEffortThe analysis effort level. |
java.lang.String |
findbugsLevelThe priority threshold for reporting bugs. |
java.lang.String |
findbugsVersion |
java.util.List<java.lang.String> |
lintOptionsJavac lint options to show compiler warnings, not visible by default. |
boolean |
pmdEnable PMD plugin. |
java.lang.String |
pmdVersion |
java.util.Collection<org.gradle.api.tasks.SourceSet> |
sourceSetsSource sets to apply checks on. |
boolean |
spotbugsEnable SpotBugs plugin. |
java.lang.String |
spotbugsEffortThe analysis effort level. |
java.lang.String |
spotbugsLevelThe priority threshold for reporting bugs. |
java.lang.String |
spotbugsVersion |
boolean |
strictStrict quality leads to build fail on any violation found. |
| Constructor and description |
|---|
QualityExtension
(org.gradle.api.Project project) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Sets AnimalSniffer version. Works only when 'ru.vyarus.animalsniffer' plugin applied.
Automatically register quality plugins, based on configured (affected) sources (sourceSets). For example, if configured sources contain only java sources then only pmd, checkstyle and spotbugs (findbugs) plugins will be activated; if only groovy sources - then codenarc only.
When disabled, quality plugins must be registered manually. Only registered plugins will be configured if configuration is not disabled with plugin flags (pmd, checkstyle etc.). True by default.
Enable Checkstyle plugin. True by default. If plugin enabled manually then disabling this option will prevent applying plugin configuration.
Enable CodeNarc plugin. Ignored if groovy plugin is not applied). True by default. If plugin enabled manually then disabling this option will prevent applying plugin configuration.
Configuration files directory. It may contain custom plugin configurations (not required). By default its gradle/config/.
When false, disables reporting quality issues to console. Only gradle general error messages will remain in logs. This may be useful in cases when project contains too many warnings. Also, console reporting require xml reports parsing, which could be time consuming in case of too many errors (large xml reports). True by default.
When false, disables quality tasks execution. Allows disabling tasks without removing plugins. Quality tasks are still registered, but skip execution, except when task called directly or through checkQualityMain (or other source set) grouping task. True by default.
Source patterns (relative to source dir) to exclude from checks. Simply sets exclusions to quality tasks.
Animalsniffer is not affected because it's a different kind of check (and, also, it operates on classes so source patterns may not comply).
Spotbugs (findbugs) does not support exclusion directly, but plugin will resolve excluded classes and apply them to xml exclude file (default one or provided by user).
By default nothing is excluded.
IMPORTANT: Patterns are checked relatively to source set dirs (not including them). So you can only match source files and packages, but not absolute file path (this is gradle specific, not plugin).
Direct sources to exclude from checks (except animalsniffer). This is useful as last resort, when extension or package is not enough for filtering. Use Project#files(java.lang.Object) or Project#fileTree(java.lang.Object) to create initial collections and apply filter on it (using org.gradle.api.file.FileTree#matching(groovy.lang.Closure)).
Plugin will include files into spotbugs (findbugs) exclusion filter xml (default one or provided by user).
Note: this must be used when excluded classes can't be extracted to different source set and filter by package and filename is not sufficient.
Enable FindBugs plugin. True by default. If plugin enabled manually then disabling this option will prevent applying plugin configuration. Plugin is not enabled and not configured when spotbugs plugin enabled.
The analysis effort level. The value specified should be one of min, default, or max. Higher levels increase precision and find more bugs at the expense of running time and memory consumption. Default is 'max'.
The priority threshold for reporting bugs. If set to low, all bugs are reported. If set to medium, medium and high priority bugs are reported. If set to high, only high priority bugs are reported. Default is 'medium'.
Javac lint options to show compiler warnings, not visible by default. By default enables deprecation and unchecked options. Applies to all JavaCompile tasks. Full list of options: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJCABJ
Enable PMD plugin. True by default. If plugin enabled manually then disabling this option will prevent applying plugin configuration.
Source sets to apply checks on. Default is [project.sourceSets.main] to apply only for project sources, excluding tests.
Enable SpotBugs plugin. True by default. If plugin enabled manually then disabling this option will prevent applying plugin configuration.
The analysis effort level. The value specified should be one of min, default, or max. Higher levels increase precision and find more bugs at the expense of running time and memory consumption. Default is 'max'.
The priority threshold for reporting bugs. If set to low, all bugs are reported. If set to medium, medium and high priority bugs are reported. If set to high, only high priority bugs are reported. Default is 'medium'.
Strict quality leads to build fail on any violation found. If disabled, all violation are just printed to console (if console reporting enabled). True by default.
Shortcut for exclude
patterns - exclusion patterns (relative to source root)Groovy Documentation