# The Checkstyle Plugin

The Checkstyle plugin performs quality checks on your project's Java source files using Checkstyle and generates reports from these checks.

## Usage

To use the Checkstyle plugin, include in your build script:

The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running `gradle check`.

## Tasks

The Checkstyle plugin adds the following tasks to the project:

## Checkstyle plugin - tasks

Task name | Depends on | Type | Description
`checkstyleMain` | `classes` |  | Runs Checkstyle against the production Java source files.
`checkstyleTest` | `testClasses` |  | Runs Checkstyle against the test Java source files.
`checkstyle`SourceSet`` | ``sourceSet`Classes` |  | Runs Checkstyle against the given source set's Java source files.

The Checkstyle plugin adds the following dependencies to tasks defined by the Java plugin.

## Checkstyle plugin - additional task dependencies

Task name | Depends on
`check` | All Checkstyle tasks, including `checkstyleMain` and `checkstyleTest`.

## Project layout

The Checkstyle plugin expects the following project layout:

## Checkstyle plugin - project layout

File | Meaning
`config/checkstyle/checkstyle.xml` | Checkstyle configuration file

## Dependency management

The Checkstyle plugin adds the following dependency configurations:

## Checkstyle plugin - dependency configurations

Name | Meaning
`checkstyle` | The Checkstyle libraries to use

## Configuration

See .