api / org.gradle.api.tasks / OutputDirectories

OutputDirectories

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

Marks a property as specifying one or more output directories for a task.

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.

This will cause the task to be considered out-of-date when the directory paths or task output to those directories have been modified since the task was last run.

When the annotated property is a java.util.Map, then each output directory will be associated with an identity. For cacheable tasks this is a requirement. The keys of the map must be non-empty strings. The values of the map will be evaluated to individual directories as per org.gradle.api.Project#file(Object).

Otherwise the given directories will be evaluated as per org.gradle.api.Project#files(Object...), and task output caching will be disabled for the task.

Constructors

<init>

OutputDirectories()

Marks a property as specifying one or more output directories for a task.

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.

This will cause the task to be considered out-of-date when the directory paths or task output to those directories have been modified since the task was last run.

When the annotated property is a java.util.Map, then each output directory will be associated with an identity. For cacheable tasks this is a requirement. The keys of the map must be non-empty strings. The values of the map will be evaluated to individual directories as per org.gradle.api.Project#file(Object).

Otherwise the given directories will be evaluated as per org.gradle.api.Project#files(Object...), and task output caching will be disabled for the task.