api / org.gradle.api.tasks / SkipWhenEmpty

SkipWhenEmpty

@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD]) class SkipWhenEmpty

Attached to a task property to indicate that the task should be skipped when the value of the property is an empty org.gradle.api.file.FileCollection or directory.

If all of the inputs declared with this annotation are empty, the task will be skipped with a "NO-SOURCE" message.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

Constructors

<init>

SkipWhenEmpty()

Attached to a task property to indicate that the task should be skipped when the value of the property is an empty org.gradle.api.file.FileCollection or directory.

If all of the inputs declared with this annotation are empty, the task will be skipped with a "NO-SOURCE" message.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

  • org.gradle.api.tasks.InputFiles
  • org.gradle.api.tasks.InputDirectory