gradle
8.4

# SkipWhenEmpty

@Documented
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.METHOD, ElementType.FIELD])
annotation class SkipWhenEmpty(source)

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.

Consider using IgnoreEmptyDirectories as well, if the task only works on files and not on directories.

This annotation implies org.gradle.work.Incremental, and thus inputs annotated with this annotation can also be queried for changes.

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

## Functions

annotationType
Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
hashCode
Link copied to clipboard
abstract fun hashCode(): Int
toString
Link copied to clipboard
abstract fun toString(): String