Package org.gradle.api.plugins.quality
Klasse 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.AbstractCodeQualityTask
org.gradle.api.plugins.quality.Checkstyle
- Alle implementierten Schnittstellen:
Comparable<Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.IConventionAware,org.gradle.api.internal.TaskInternal,Named,ExtensionAware,Reporting<CheckstyleReports>,Task,PatternFilterable,VerificationTask,Configurable<Task>
@CacheableTask
public abstract class Checkstyle
extends AbstractCodeQualityTask
implements Reporting<CheckstyleReports>
Runs Checkstyle against some source files.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.Task
Task.Namer -
Feldübersicht
Von Schnittstelle geerbte Felder org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungThe class path containing the Checkstyle library to be used.The class path containing the compiled classes for the source files to be analyzed.The 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 use of external DTD files in configuration files.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.final CheckstyleReportsThe reports to be generated by this task.Returns the source for this task, after the include and exclude patterns have been applied.booleanWhether the build should break when the verifications performed by this task fail.booleanWhether rule violations are to be displayed on the console.Configures the reports to be generated by this task.reports(Action<? super CheckstyleReports> configureAction) Configures the reports to be generated by this task.voidrun()voidsetCheckstyleClasspath(FileCollection checkstyleClasspath) The class path containing the Checkstyle library to be used.voidsetClasspath(FileCollection classpath) The class path containing the compiled classes for the source files to be analyzed.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.Von Klasse geerbte Methoden org.gradle.api.plugins.quality.AbstractCodeQualityTask
configureForkOptions, getIgnoreFailures, getIgnoreFailuresProperty, getJavaLauncher, getMaxHeapSize, getMinHeapSize, getObjectFactory, getToolchainService, getWorkerExecutor, setIgnoreFailuresVon Klasse geerbte Methoden org.gradle.api.tasks.SourceTask
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceVon Klasse geerbte Methoden org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingVon Klasse geerbte Methoden org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceVon Klasse geerbte Methoden org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Konstruktordetails
-
Checkstyle
public Checkstyle()
-
-
Methodendetails
-
getConfigFile
The Checkstyle configuration file to use. -
setConfigFile
The Checkstyle configuration file to use. -
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/checkstyle.html" } } }- Angegeben von:
reportsin SchnittstelleReporting<CheckstyleReports>- Parameter:
closure- The configuration- Gibt zurück:
- The reports container
-
reports
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/checkstyle.html" } } }- Angegeben von:
reportsin SchnittstelleReporting<CheckstyleReports>- Parameter:
configureAction- The configuration- Gibt zurück:
- The reports container
- Seit:
- 3.0
-
run
public void run() -
getSource
Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.The
PathSensitivityfor the sources is configured to bePathSensitivity.ABSOLUTE. If your sources are less strict, please change it accordingly by overriding this method in your subclass.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.
- Setzt außer Kraft:
getSourcein KlasseSourceTask- Gibt zurück:
- The source.
-
getCheckstyleClasspath
The class path containing the Checkstyle library to be used. -
setCheckstyleClasspath
The class path containing the Checkstyle library to be used. -
getClasspath
The class path containing the compiled classes for the source files to be analyzed. -
setClasspath
The class path containing the compiled classes for the source files to be analyzed. -
getConfig
The Checkstyle configuration to use. Replaces theconfigFileproperty.- Seit:
- 2.2
-
setConfig
The Checkstyle configuration to use. Replaces theconfigFileproperty.- Seit:
- 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. -
getConfigDirectory
Path to other Checkstyle configuration files.This path will be exposed as the variable
config_locin Checkstyle's configuration files.- Gibt zurück:
- path to other Checkstyle configuration files
- Seit:
- 6.0
-
getReports
The reports to be generated by this task.- Angegeben von:
getReportsin SchnittstelleReporting<CheckstyleReports>- Gibt zurück:
- The report container
-
getMaxErrors
The maximum number of errors that are tolerated before breaking the build or setting the failure property.- Gibt zurück:
- the maximum number of errors allowed
- Seit:
- 3.4
-
setMaxErrors
public void setMaxErrors(int maxErrors) Set the maximum number of errors that are tolerated before breaking the build.- Parameter:
maxErrors- number of errors allowed- Seit:
- 3.4
-
getMaxWarnings
The maximum number of warnings that are tolerated before breaking the build or setting the failure property.- Gibt zurück:
- the maximum number of warnings allowed
- Seit:
- 3.4
-
setMaxWarnings
public void setMaxWarnings(int maxWarnings) Set the maximum number of warnings that are tolerated before breaking the build.- Parameter:
maxWarnings- number of warnings allowed- Seit:
- 3.4
-
isShowViolations
Whether rule violations are to be displayed on the console.- Gibt zurück:
- true if violations should be displayed on console
-
setShowViolations
public void setShowViolations(boolean showViolations) Whether rule violations are to be displayed on the console. -
getEnableExternalDtdLoad
Enable the use of external DTD files in configuration files. Disabled by default because this may be unsafe. See Checkstyle documentation for more details.- Gibt zurück:
- property to enable the use of external DTD files
- Seit:
- 7.6
-
isIgnoreFailures
Whether the build should break when the verifications performed by this task fail.- Gibt zurück:
- true if failures should be ignored
-