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 SummaryConstructors
- 
Method SummaryModifier 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.Enable the ability to use custom DTD files in config and load them from some location on all checkstyle tasks in this project.intThe maximum number of errors that are tolerated before breaking the build or setting the failure property.intThe maximum number of warnings that are tolerated before breaking the build or setting the failure property.booleanWhether rule violations are to be displayed on the console.voidsetConfig(TextResource config) The Checkstyle configuration to use.voidsetConfigFile(File configFile) The Checkstyle configuration file to use.voidsetConfigProperties(Map<String, Object> configProperties) The properties available for use in the configuration file.voidsetMaxErrors(int maxErrors) Set the maximum number of errors that are tolerated before breaking the build.voidsetMaxWarnings(int maxWarnings) Set the maximum number of warnings that are tolerated before breaking the build.voidsetShowViolations(boolean showViolations) Whether rule violations are to be displayed on the console.Methods inherited from class org.gradle.api.plugins.quality.CodeQualityExtensiongetReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion
- 
Constructor Details- 
CheckstyleExtension
 
- 
- 
Method Details- 
getConfigFileThe Checkstyle configuration file to use.
- 
setConfigFileThe Checkstyle configuration file to use.
- 
getConfigThe Checkstyle configuration to use. Replaces theconfigFileproperty.- Since:
- 2.2
 
- 
setConfigThe Checkstyle configuration to use. Replaces theconfigFileproperty.- Since:
- 2.2
 
- 
getConfigPropertiesThe properties available for use in the configuration file. These are substituted into the configuration file.
- 
setConfigPropertiesThe properties available for use in the configuration file. These are substituted into the configuration file.
- 
getConfigDirectoryPath to other Checkstyle configuration files. By default, this path is$rootProject.projectDir/config/checkstyleThis path will be exposed as the variable config_locin Checkstyle's configuration files.- Returns:
- path to other Checkstyle configuration files
- Since:
- 4.7
 
- 
getMaxErrorspublic int getMaxErrors()The maximum number of errors that are tolerated before breaking the build or setting the failure property. Defaults to0.Example: maxErrors = 42 - Returns:
- the maximum number of errors allowed
- Since:
- 3.4
 
- 
setMaxErrorspublic 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
 
- 
getMaxWarningspublic int getMaxWarnings()The maximum number of warnings that are tolerated before breaking the build or setting the failure property. Defaults toInteger.MAX_VALUE.Example: maxWarnings = 1000 - Returns:
- the maximum number of warnings allowed
- Since:
- 3.4
 
- 
setMaxWarningspublic 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
 
- 
isShowViolationspublic boolean isShowViolations()Whether rule violations are to be displayed on the console. Defaults totrue. Example: showViolations = false
- 
setShowViolationspublic void setShowViolations(boolean showViolations) Whether rule violations are to be displayed on the console. Defaults totrue. Example: showViolations = false
- 
getEnableExternalDtdLoadEnable the ability to use custom DTD files in config and load them from some location on all checkstyle tasks in this project. Disabled by default due to security concerns. See Checkstyle documentation for more details.- Returns:
- The property controlling whether to enable the ability to use custom DTD files
- Since:
- 7.6
 
 
-