java.lang.Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Reporting<CheckstyleReports>, Task, PatternFilterable, VerificationTask, Configurable<Task>@CacheableTask public class Checkstyle extends SourceTask implements VerificationTask, Reporting<CheckstyleReports>
Task.NamerTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor | Description |
|---|---|
Checkstyle() |
| Modifier and Type | Method | Description |
|---|---|---|
org.gradle.api.internal.project.IsolatedAntBuilder |
getAntBuilder() |
Deprecated.
|
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.
|
DirectoryProperty |
getConfigDirectory() |
Path to other Checkstyle configuration files.
|
java.io.File |
getConfigFile() |
The Checkstyle configuration file to use.
|
java.util.Map<java.lang.String,java.lang.Object> |
getConfigProperties() |
The properties available for use in the configuration file.
|
Property<java.lang.Boolean> |
getEnableExternalDtdLoad() |
Enable the use of external DTD files in configuration files.
|
boolean |
getIgnoreFailures() |
Whether or not this task will ignore failures and continue running the build.
|
Property<JavaLauncher> |
getJavaLauncher() |
JavaLauncher for toolchain support.
|
int |
getMaxErrors() |
The maximum number of errors that are tolerated before breaking the build
or setting the failure property.
|
Property<java.lang.String> |
getMaxHeapSize() |
The maximum heap size for the Checkstyle worker process, if any.
|
int |
getMaxWarnings() |
The maximum number of warnings that are tolerated before breaking the build
or setting the failure property.
|
Property<java.lang.String> |
getMinHeapSize() |
The minimum heap size for the Checkstyle worker process, if any.
|
protected ObjectFactory |
getObjectFactory() |
|
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.
|
protected JavaToolchainService |
getToolchainService() |
|
WorkerExecutor |
getWorkerExecutor() |
|
boolean |
isIgnoreFailures() |
Whether this task will ignore failures and continue running the build.
|
boolean |
isShowViolations() |
Whether rule violations are to be displayed on the console.
|
CheckstyleReports |
reports(Closure closure) |
Configures the reports to be generated by this task.
|
CheckstyleReports |
reports(Action<? super CheckstyleReports> configureAction) |
Configures the reports to be generated by this task.
|
void |
run() |
|
void |
setCheckstyleClasspath(FileCollection checkstyleClasspath) |
The class path containing the Checkstyle library to be used.
|
void |
setClasspath(FileCollection classpath) |
The class path containing the compiled classes for the source files to be analyzed.
|
void |
setConfig(TextResource config) |
The Checkstyle configuration to use.
|
void |
setConfigFile(java.io.File configFile) |
The Checkstyle configuration file to use.
|
void |
setConfigProperties(java.util.Map<java.lang.String,java.lang.Object> configProperties) |
The properties available for use in the configuration file.
|
void |
setIgnoreFailures(boolean ignoreFailures) |
Whether this task will ignore failures and continue running the build.
|
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.
|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceconventionMapping, conventionMapping, getConventionMappingcompareTo, 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, usesServiceappendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoNotTrackState, getConvention, notCompatibleWithConfigurationCache@Internal public java.io.File getConfigFile()
public void setConfigFile(java.io.File configFile)
@Inject protected ObjectFactory getObjectFactory()
@Inject protected JavaToolchainService getToolchainService()
@Inject @Deprecated public org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()
@Inject public WorkerExecutor getWorkerExecutor()
public CheckstyleReports reports(@DelegatesTo(value=CheckstyleReports.class,strategy=1) Closure closure)
checkstyleTask {
reports {
html {
destination "build/checkstyle.html"
}
}
}
reports in interface Reporting<CheckstyleReports>closure - The configurationpublic CheckstyleReports reports(Action<? super CheckstyleReports> configureAction)
checkstyleTask {
reports {
html {
destination "build/checkstyle.html"
}
}
}
reports in interface Reporting<CheckstyleReports>configureAction - The configuration@Incubating public Property<JavaLauncher> getJavaLauncher()
public void run()
@PathSensitive(RELATIVE) public FileTree getSource()
The PathSensitivity for the sources is configured to be PathSensitivity.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.
getSource in class SourceTask@Classpath public FileCollection getCheckstyleClasspath()
public void setCheckstyleClasspath(FileCollection checkstyleClasspath)
@Classpath public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)
public TextResource getConfig()
configFile property.public void setConfig(TextResource config)
configFile property.@Nullable @Optional @Input public java.util.Map<java.lang.String,java.lang.Object> getConfigProperties()
public void setConfigProperties(@Nullable
java.util.Map<java.lang.String,java.lang.Object> configProperties)
@PathSensitive(RELATIVE) @InputFiles public DirectoryProperty getConfigDirectory()
This path will be exposed as the variable config_loc in Checkstyle's configuration files.
public final CheckstyleReports getReports()
getReports in interface Reporting<CheckstyleReports>public boolean getIgnoreFailures()
getIgnoreFailures in interface VerificationTask@Internal public boolean isIgnoreFailures()
public void setIgnoreFailures(boolean ignoreFailures)
setIgnoreFailures in interface VerificationTaskignoreFailures - false to break the build on failure, true to ignore the failures. The default is false.@Input public int getMaxErrors()
public void setMaxErrors(int maxErrors)
maxErrors - number of errors allowed@Input public int getMaxWarnings()
public void setMaxWarnings(int maxWarnings)
maxWarnings - number of warnings allowed@Console public boolean isShowViolations()
public void setShowViolations(boolean showViolations)
@Incubating @Optional @Input public Property<java.lang.String> getMinHeapSize()
@Incubating @Optional @Input public Property<java.lang.String> getMaxHeapSize()
@Incubating @Input public Property<java.lang.Boolean> getEnableExternalDtdLoad()