@groovy.transform.CompileStatic class QualityPlugin extends java.lang.Object
Quality plugin enables and configures quality plugins for java and groovy projects. Plugin must be registered after java or groovy plugins, otherwise wil do nothing.
Java project is detected by presence of java sources. In this case Checkstyle, PMD and Spotbugs plugins are activated. If quality plugins applied manually, they would be configured too (even if auto detection didn't recognize related sources). Also, additional javac lint options are activated to show more warnings during compilation.
If groovy plugin enabled, CodeNarc plugin activated.
All plugins are configured to produce xml and html reports. For spotbugs html report generated manually. All plugins violations are printed into console in unified format which makes console output good enough for fixing violations.
Plugin may be configured with 'quality' closure. See QualityExtension for configuration options.
By default, plugin use bundled quality plugins configurations. These configs could be copied into project with 'initQualityConfig' task (into quality.configDir directory). These custom configs will be used in priority with fallback to default config if config not found.
Special tasks registered for each source set: checkQualityMain, checkQualityTest etc.
Tasks group registered quality plugins tasks for specific source set. This allows running quality plugins
directly without tests (comparing to using 'check' task). Also, allows running quality plugins on source sets
not enabled for main 'check' (example case: run quality checks for tests (time to time)). These tasks may be
used even when quality tasks are disabled (quality.enabled = false).
| Modifiers | Name | Description |
|---|---|---|
static class |
QualityPlugin.Context |
Internal configuration context. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(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() |