Class ValidateTaskProperties
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.plugin.devel.tasks.ValidateTaskProperties
- All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, VerificationTask, org.gradle.plugin.devel.tasks.internal.ValidateTaskPropertiesBackwardsCompatibleAdapter, org.gradle.util.Configurable<Task>
@CacheableTask
public class ValidateTaskProperties
extends org.gradle.api.internal.ConventionTask
implements VerificationTask, org.gradle.plugin.devel.tasks.internal.ValidateTaskPropertiesBackwardsCompatibleAdapter
Validates task property annotations.
Task properties must be annotated with one of:
-
Properties taken into account during up-to-date checks:
-
@
Input, @Nested, @InputFile, @InputDirectory, @InputFilesto mark it as an input to the task. -
@
OutputFile, @OutputDirectoryto mark it as an output of the task.
-
@
-
Properties ignored during up-to-date checks:
- @
Injectmarks a Gradle service used by the task. - @
Consolemarks a property that only influences the console output of the task. - @
Internalmark an internal property of the task. - @
ReplacedBymark a property as replaced by another (similar toInternal).
- @
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface Task
Task.Namer -
Field Summary
Fields inherited from interface Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe classes to validate.protected org.gradle.internal.classloader.ClassLoaderFactoryThe classpath used to load the classes under validation.protected org.gradle.api.internal.DocumentationRegistrybooleanEnable the stricter validation for cacheable tasks for all tasks.booleanReturns whether the build should break when the verifications performed by this task detects a warning.booleanSpecifies whether the build should break when the verifications performed by this task fail.Returns the output file to store the report in.voidsetClasses(FileCollection classes) Deprecated.voidsetClasspath(FileCollection classpath) Deprecated.UsegetClasspath().setFrom instead.voidsetEnableStricterValidation(boolean enableStricterValidation) Enable the stricter validation for cacheable tasks for all tasks.voidsetFailOnWarning(boolean failOnWarning) Specifies whether the build should break when the verifications performed by this task detects a warning.voidsetIgnoreFailures(boolean ignoreFailures) Specifies whether the build should break when the verifications performed by this task fail.voidMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class DefaultTask
newInputDirectory, newInputFile, newOutputDirectory, newOutputFileMethods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
-
Constructor Details
-
ValidateTaskProperties
-
-
Method Details
-
validateTaskClasses
- Throws:
IOException
-
getIgnoreFailures
public boolean getIgnoreFailures()Specifies whether the build should break when the verifications performed by this task fail.- Specified by:
getIgnoreFailuresin interfaceVerificationTask- Returns:
- false, when the build should break on failure, true when the failures should be ignored.
-
setIgnoreFailures
public void setIgnoreFailures(boolean ignoreFailures) Specifies whether the build should break when the verifications performed by this task fail.- Specified by:
setIgnoreFailuresin interfaceVerificationTask- Parameters:
ignoreFailures- false to break the build on failure, true to ignore the failures. The default is false.
-
getClasses
The classes to validate.- Specified by:
getClassesin interfaceorg.gradle.plugin.devel.tasks.internal.ValidateTaskPropertiesBackwardsCompatibleAdapter- Since:
- 4.0
-
setClasses
-
getClasspath
The classpath used to load the classes under validation.- Specified by:
getClasspathin interfaceorg.gradle.plugin.devel.tasks.internal.ValidateTaskPropertiesBackwardsCompatibleAdapter
-
setClasspath
Deprecated.UsegetClasspath().setFrom instead.Sets the classpath used to load the classes under validation. -
getFailOnWarning
Returns whether the build should break when the verifications performed by this task detects a warning. -
getEnableStricterValidation
Enable the stricter validation for cacheable tasks for all tasks.- Since:
- 5.1
-
setEnableStricterValidation
Enable the stricter validation for cacheable tasks for all tasks.- Since:
- 5.1
-
getOutputFile
Returns the output file to store the report in.- Since:
- 4.5
-
setFailOnWarning
public void setFailOnWarning(boolean failOnWarning) Specifies whether the build should break when the verifications performed by this task detects a warning.- Parameters:
failOnWarning-trueto break the build on warning,falseto ignore warnings. The default isfalse.
-
getClassLoaderFactory
@Inject protected org.gradle.internal.classloader.ClassLoaderFactory getClassLoaderFactory() -
getDocumentationRegistry
@Inject protected org.gradle.api.internal.DocumentationRegistry getDocumentationRegistry()
-
getClasses().setFrom instead.