Class AndroidCheckstyleExtension
- java.lang.Object
-
- io.freefair.gradle.plugins.android.quality.AndroidCodeQualityExtension
-
- io.freefair.gradle.plugins.android.quality.SourceSetBasedCodeQualityExtension
-
- io.freefair.gradle.plugins.android.quality.AndroidCheckstyleExtension
-
public class AndroidCheckstyleExtension extends SourceSetBasedCodeQualityExtension
- See Also:
CheckstyleExtension
-
-
Constructor Summary
Constructors Constructor Description AndroidCheckstyleExtension(Project project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)TextResourcegetConfig()The Checkstyle configuration to use.FilegetConfigDir()Path to other Checkstyle configuration files.DirectoryPropertygetConfigDirectory()Gets the configuration directory.FilegetConfigFile()The Checkstyle configuration file to use.Map<String,Object>getConfigProperties()The properties available for use in the configuration file.intgetMaxErrors()The maximum number of errors that are tolerated before breaking the build or setting the failure property.intgetMaxWarnings()The maximum number of warnings that are tolerated before breaking the build or setting the failure property.inthashCode()booleanisShowViolations()Whether rule violations are to be displayed on the console.voidsetConfig(TextResource config)The Checkstyle configuration to use.voidsetConfigDir(File configDir)Path to other Checkstyle configuration files.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 io.freefair.gradle.plugins.android.quality.SourceSetBasedCodeQualityExtension
getSourceSets, setSourceSets, toString
-
Methods inherited from class io.freefair.gradle.plugins.android.quality.AndroidCodeQualityExtension
getReportsDir, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setToolVersion
-
-
-
-
Constructor Detail
-
AndroidCheckstyleExtension
public AndroidCheckstyleExtension(Project project)
-
-
Method Detail
-
getConfigFile
public File getConfigFile()
The Checkstyle configuration file to use.
-
setConfigFile
public void setConfigFile(File configFile)
The Checkstyle configuration file to use.
-
getConfig
public TextResource getConfig()
The Checkstyle configuration to use. Replaces theconfigFileproperty.- Since:
- 2.2
-
setConfig
public void setConfig(TextResource config)
The Checkstyle configuration to use. Replaces theconfigFileproperty.- Since:
- 2.2
-
getConfigProperties
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)
The properties available for use in the configuration file. These are substituted into the configuration file.
-
getConfigDir
@Incubating public File getConfigDir()
Path 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.0
-
setConfigDir
@Incubating public void setConfigDir(File configDir)
Path 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.- Since:
- 4.0
-
getConfigDirectory
@Incubating public DirectoryProperty getConfigDirectory()
Gets the configuration directory.- Returns:
- The configuration directory
- Since:
- 4.7
-
getMaxErrors
public 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
-
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 toInteger.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 totrue.Example: showViolations = false
-
setShowViolations
public void setShowViolations(boolean showViolations)
Whether rule violations are to be displayed on the console. Defaults totrue.Example: showViolations = false
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classSourceSetBasedCodeQualityExtension
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqualin classSourceSetBasedCodeQualityExtension
-
hashCode
public int hashCode()
- Overrides:
hashCodein classSourceSetBasedCodeQualityExtension
-
-