org.gradle.api.plugins.quality

## Class Checkstyle

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.api.internal.ConventionTask
      - - org.gradle.api.tasks.SourceTask
        - - org.gradle.api.plugins.quality.Checkstyle

- All Implemented Interfaces:
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Reporting<CheckstyleReports>, Task, PatternFilterable, VerificationTask, org.gradle.util.Configurable<Task>

      @CacheableTask
      public class Checkstyle
      extends SourceTask
      implements VerificationTask, Reporting<CheckstyleReports>

  Runs Checkstyle against some source files.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from class org.gradle.api.tasks.SourceTask

      `source`

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Checkstyle()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.gradle.api.internal.project.IsolatedAntBuilder` | `getAntBuilder()`
    `FileCollection` | `getCheckstyleClasspath()` The class path containing the Checkstyle library to be used.
    `FileCollection` | `getClasspath()` The class path containing the compiled classes for the source files to be analyzed.
    `TextResource` | `getConfig()` The Checkstyle configuration to use.
    `File` | `getConfigFile()` The Checkstyle configuration file to use.
    `Map<String,Object>` | `getConfigProperties()` The properties available for use in the configuration file.
    `boolean` | `getIgnoreFailures()` Whether or not this task will ignore failures and continue running the build.
    `org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `CheckstyleReports` | `getReports()` The reports to be generated by this task.
    `FileTree` | `getSource()` Returns the source for this task, after the include and exclude patterns have been applied.
    `boolean` | `isIgnoreFailures()` Whether or not this task will ignore failures and continue running the build.
    `boolean` | `isShowViolations()` Whether or not rule violations are to be displayed on the console.
    `CheckstyleReports` | `reports(Action<? super CheckstyleReports> configureAction)` Configures the reports to be generated by this task.
    `CheckstyleReports` | `reports(Closure closure)` Configures the reports to be generated by this task.
    `void` | `run()`
    `void` | `setCheckstyleClasspath(FileCollection checkstyleClasspath)`
    `void` | `setClasspath(FileCollection classpath)`
    `void` | `setConfig(TextResource config)`
    `void` | `setConfigFile(File configFile)` The Checkstyle configuration file to use.
    `void` | `setConfigProperties(Map<String,Object> configProperties)`
    `void` | `setIgnoreFailures(boolean ignoreFailures)` Specifies whether the build should break when the verifications performed by this task fail.
    `void` | `setShowViolations(boolean showViolations)`

    - ### Methods inherited from class org.gradle.api.tasks.SourceTask

      `exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, source`

    - ### Methods inherited from class org.gradle.api.internal.ConventionTask

      `conventionMapping, conventionMapping, getConventionMapping`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Checkstyle

          public Checkstyle()

  - ### Method Detail

    - #### getConfigFile

          @Internal
          public File getConfigFile()

      The Checkstyle configuration file to use.

    - #### setConfigFile

          public void setConfigFile(File configFile)

      The Checkstyle configuration file to use.

    - #### getInstantiator

          @Inject
          public org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### getAntBuilder

          @Inject
          public org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()

    - #### reports

          public CheckstyleReports reports(@DelegatesTo(value=CheckstyleReports.class,strategy=1)
                                  Closure closure)

      Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:

           checkstyleTask {
             reports {
               html {
                 destination "build/codenarc.html"
               }
             }
           }

      Specified by:
        `reports` in interface `Reporting<CheckstyleReports>`
      Parameters:
        `closure` - The configuration
      Returns:
        The reports container

    - #### reports

          public CheckstyleReports reports(Action<? super CheckstyleReports> configureAction)

      Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:

           checkstyleTask {
             reports {
               html {
                 destination "build/codenarc.html"
               }
             }
           }

      Specified by:
        `reports` in interface `Reporting<CheckstyleReports>`
      Parameters:
        `configureAction` - The configuration
      Returns:
        The reports container
      Since:
        3.0

    - #### run

          public void run()

    - #### getSource

          @PathSensitive(value=RELATIVE)
          public FileTree getSource()

      Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

      The sources for this task are relatively relocatable even though it produces output that includes absolute paths. This is a compromise made to ensure that results can be reused between different builds. The downside is that up-to-date results, or results loaded from cache can show different absolute paths than would be produced if the task was executed.

      Overrides:
        `getSource` in class `SourceTask`
      Returns:
        The source.

    - #### getCheckstyleClasspath

          @Classpath
          public FileCollection getCheckstyleClasspath()

      The class path containing the Checkstyle library to be used.

    - #### setCheckstyleClasspath

          public void setCheckstyleClasspath(FileCollection checkstyleClasspath)

    - #### getClasspath

          @Classpath
          public FileCollection getClasspath()

      The class path containing the compiled classes for the source files to be analyzed.

    - #### setClasspath

          public void setClasspath(FileCollection classpath)

    - #### getConfig

          @Incubating
          public TextResource getConfig()

      The Checkstyle configuration to use. Replaces the `configFile` property.
      Since:
        2.2

    - #### setConfig

          public void setConfig(TextResource config)

    - #### getConfigProperties

          @Input
          @Optional
          public Map<String,Object> getConfigProperties()

      The properties available for use in the configuration file. These are substituted into the configuration file.

    - #### setConfigProperties

          public void setConfigProperties(Map<String,Object> configProperties)

    - #### getReports

          public final CheckstyleReports getReports()

      The reports to be generated by this task.
      Specified by:
        `getReports` in interface `Reporting<CheckstyleReports>`
      Returns:
        The report container

    - #### getIgnoreFailures

          @Input
          public boolean getIgnoreFailures()

      Whether or not this task will ignore failures and continue running the build.
      Specified by:
        `getIgnoreFailures` in interface `VerificationTask`
      Returns:
        true if failures should be ignored

    - #### isIgnoreFailures

          public boolean isIgnoreFailures()

      Whether or not this task will ignore failures and continue running the build.
      Returns:
        true if failures should be ignored

    - #### setIgnoreFailures

          public void setIgnoreFailures(boolean ignoreFailures)

      Description copied from interface: `VerificationTask`
      Specifies whether the build should break when the verifications performed by this task fail.
      Specified by:
        `setIgnoreFailures` in interface `VerificationTask`
      Parameters:
        `ignoreFailures` - false to break the build on failure, true to ignore the failures. The default is false.

    - #### isShowViolations

          @Console
          public boolean isShowViolations()

      Whether or not rule violations are to be displayed on the console.
      Returns:
        true if violations should be displayed on console

    - #### setShowViolations

          public void setShowViolations(boolean showViolations)