Package org.gradle.api.plugins.quality
Class CheckstyleExtension
java.lang.Object
org.gradle.api.plugins.quality.CodeQualityExtension
org.gradle.api.plugins.quality.CheckstyleExtension
Configuration options for the Checkstyle plugin.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe Checkstyle configuration to use.Path to other Checkstyle configuration files.The Checkstyle configuration file to use.The properties available for use in the configuration file.int
The maximum number of errors that are tolerated before breaking the build or setting the failure property.int
The maximum number of warnings that are tolerated before breaking the build or setting the failure property.boolean
Whether rule violations are to be displayed on the console.void
setConfig
(TextResource config) The Checkstyle configuration to use.void
setConfigDir
(File configDir) Path to other Checkstyle configuration files.void
setConfigFile
(File configFile) The Checkstyle configuration file to use.void
setConfigProperties
(Map<String, Object> configProperties) The properties available for use in the configuration file.void
setMaxErrors
(int maxErrors) Set the maximum number of errors that are tolerated before breaking the build.void
setMaxWarnings
(int maxWarnings) Set the maximum number of warnings that are tolerated before breaking the build.void
setShowViolations
(boolean showViolations) Whether rule violations are to be displayed on the console.Methods inherited from class org.gradle.api.plugins.quality.CodeQualityExtension
getReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion
-
Constructor Details
-
CheckstyleExtension
-
-
Method Details
-
getConfigFile
The Checkstyle configuration file to use. -
setConfigFile
The Checkstyle configuration file to use. -
getConfig
The Checkstyle configuration to use. Replaces theconfigFile
property.- Since:
- 2.2
-
setConfig
The Checkstyle configuration to use. Replaces theconfigFile
property.- Since:
- 2.2
-
getConfigProperties
The properties available for use in the configuration file. These are substituted into the configuration file. -
setConfigProperties
The properties available for use in the configuration file. These are substituted into the configuration file. -
getConfigDir
Path to other Checkstyle configuration files. By default, this path is$projectDir/config/checkstyle
This path will be exposed as the variable
config_loc
in Checkstyle's configuration files.- Returns:
- path to other Checkstyle configuration files
- Since:
- 4.0
-
setConfigDir
Path to other Checkstyle configuration files. By default, this path is$projectDir/config/checkstyle
This path will be exposed as the variable
config_loc
in Checkstyle's configuration files.- Since:
- 4.0
-
getMaxErrors
public int getMaxErrors()The maximum number of errors that are tolerated before breaking the build or setting the failure property. Defaults to 0.Example: maxErrors = 42
- Returns:
- the maximum number of errors allowed
- Since:
- 3.4
-
setMaxErrors
public void setMaxErrors(int maxErrors) Set the maximum number of errors that are tolerated before breaking the build.- Parameters:
maxErrors
- number of errors allowed- Since:
- 3.4
-
getMaxWarnings
public int getMaxWarnings()The maximum number of warnings that are tolerated before breaking the build or setting the failure property. Defaults to Integer.MAX_VALUE.Example: maxWarnings = 1000
- Returns:
- the maximum number of warnings allowed
- Since:
- 3.4
-
setMaxWarnings
public void setMaxWarnings(int maxWarnings) Set the maximum number of warnings that are tolerated before breaking the build.- Parameters:
maxWarnings
- number of warnings allowed- Since:
- 3.4
-
isShowViolations
public boolean isShowViolations()Whether rule violations are to be displayed on the console. Defaults to true. Example: showViolations = false -
setShowViolations
public void setShowViolations(boolean showViolations) Whether rule violations are to be displayed on the console. Defaults to true. Example: showViolations = false
-