org.gradle.api.tasks

## Interface TaskOutputFilePropertyBuilder

- All Superinterfaces:
    CompatibilityAdapterForTaskOutputs, TaskFilePropertyBuilder, TaskOutputs, TaskPropertyBuilder

      @Incubating
      public interface TaskOutputFilePropertyBuilder
      extends TaskFilePropertyBuilder, TaskOutputs

  Describes an output property of a task that contains zero or more files.
  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TaskOutputFilePropertyBuilder` | `dir(Object path)` Deprecated. Use `TaskOutputs.dir(Object)` instead.
    `TaskOutputFilePropertyBuilder` | `file(Object path)` Deprecated. Use `TaskOutputs.file(Object)` instead.
    `TaskOutputFilePropertyBuilder` | `files(Object... paths)` Deprecated. Use `TaskOutputs.files(Object...)` instead.
    `FileCollection` | `getFiles()` Deprecated. Use `TaskOutputs.getFiles()` instead.
    `boolean` | `getHasOutput()` Deprecated. Use `TaskOutputs.getHasOutput()` instead.
    `TaskOutputFilePropertyBuilder` | `optional()` Marks a task property as optional.
    `TaskOutputFilePropertyBuilder` | `optional(boolean optional)` Sets whether the task property is optional.
    `void` | `upToDateWhen(Closure upToDateClosure)` Deprecated. Use `TaskOutputs.upToDateWhen(Closure)` instead.
    `void` | `upToDateWhen(Spec<? super Task> upToDateSpec)` Deprecated. Use `TaskOutputs.upToDateWhen(Spec)` instead.
    `TaskOutputFilePropertyBuilder` | `withPathSensitivity(PathSensitivity sensitivity)` Sets which part of the path of files should be considered during up-to-date checks.
    `TaskOutputFilePropertyBuilder` | `withPropertyName(String propertyName)` Sets the name for this property.

    - ### Methods inherited from interface org.gradle.api.tasks.TaskOutputs

      `cacheIf, cacheIf, dirs, doNotCacheIf, doNotCacheIf`

- - ### Method Detail

    - #### withPropertyName

          TaskOutputFilePropertyBuilder withPropertyName(String propertyName)

      Sets the name for this property. The name must be a valid Java identifier, or a series of valid Java identifiers separated with dots ('.').

      If the method is not called, or if it is called with `null`, a name will be assigned to the property automatically.

      Specified by:
        `withPropertyName` in interface `TaskPropertyBuilder`

    - #### optional

          TaskOutputFilePropertyBuilder optional()

      Marks a task property as optional. This means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

    - #### optional

          TaskOutputFilePropertyBuilder optional(boolean optional)

      Sets whether the task property is optional. If the task property is optional, it means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

    - #### withPathSensitivity

          TaskOutputFilePropertyBuilder withPathSensitivity(PathSensitivity sensitivity)

      Sets which part of the path of files should be considered during up-to-date checks.
      Specified by:
        `withPathSensitivity` in interface `TaskFilePropertyBuilder`

    - #### upToDateWhen

          @Deprecated
          void upToDateWhen(Closure upToDateClosure)

      Deprecated. Use `TaskOutputs.upToDateWhen(Closure)` instead.

      Adds a predicate to determine whether the outputs of this task are up-to-date. The given closure is executed at task execution time. The closure is passed the task as a parameter. If the closure returns false, the task outputs are considered out-of-date and the task will be executed.

      You can add multiple such predicates. The task outputs are considered out-of-date when any predicate returns false.

      Specified by:
        `upToDateWhen` in interface `TaskOutputs`
      Parameters:
        `upToDateClosure` - The closure to use to determine whether the task outputs are up-to-date.

    - #### upToDateWhen

          @Deprecated
          void upToDateWhen(Spec<? super Task> upToDateSpec)

      Deprecated. Use `TaskOutputs.upToDateWhen(Spec)` instead.

      Adds a predicate to determine whether the outputs of this task are up-to-date. The given spec is evaluated at task execution time. If the spec returns false, the task outputs are considered out-of-date and the task will be executed.

      You can add multiple such predicates. The task outputs are considered out-of-date when any predicate returns false.

      Specified by:
        `upToDateWhen` in interface `TaskOutputs`
      Parameters:
        `upToDateSpec` - The spec to use to determine whether the task outputs are up-to-date.

    - #### getHasOutput

          @Deprecated
          boolean getHasOutput()

      Deprecated. Use `TaskOutputs.getHasOutput()` instead.
      Returns true if this task has declared any outputs. Note that a task may be able to produce output files and still have an empty set of output files.
      Specified by:
        `getHasOutput` in interface `TaskOutputs`
      Returns:
        true if this task has declared any outputs, otherwise false.

    - #### getFiles

          @Deprecated
          FileCollection getFiles()

      Deprecated. Use `TaskOutputs.getFiles()` instead.
      Returns the output files of this task.
      Specified by:
        `getFiles` in interface `TaskOutputs`
      Returns:
        The output files. Returns an empty collection if this task has no output files.

    - #### files

          @Deprecated
          TaskOutputFilePropertyBuilder files(Object... paths)

      Deprecated. Use `TaskOutputs.files(Object...)` instead.
      Registers some output files for this task.

      When the given `paths` is a `Map`, then each output file will be associated with an identity. For cacheable tasks this is a requirement. The keys of the map should not be `null`, and they must be valid Java identifiers}. The values of the map will be evaluated to individual files as per `Project.file(Object)`.

      Otherwise the given files will be evaluated as per `Project.files(Object...)`, and task output caching will be disabled for the task.

      Specified by:
        `files` in interface `CompatibilityAdapterForTaskOutputs`
      Specified by:
        `files` in interface `TaskOutputs`
      Parameters:
        `paths` - The output files.
      Returns:
        this
      See Also:
        `CacheableTask`

    - #### file

          @Deprecated
          TaskOutputFilePropertyBuilder file(Object path)

      Deprecated. Use `TaskOutputs.file(Object)` instead.
      Registers some output file for this task.
      Specified by:
        `file` in interface `CompatibilityAdapterForTaskOutputs`
      Specified by:
        `file` in interface `TaskOutputs`
      Parameters:
        `path` - The output file. The given path is evaluated as per `Project.file(Object)`.
      Returns:
        a property builder to further configure this property.

    - #### dir

          @Deprecated
          TaskOutputFilePropertyBuilder dir(Object path)

      Deprecated. Use `TaskOutputs.dir(Object)` instead.
      Registers an output directory for this task.
      Specified by:
        `dir` in interface `CompatibilityAdapterForTaskOutputs`
      Specified by:
        `dir` in interface `TaskOutputs`
      Parameters:
        `path` - The output directory. The given path is evaluated as per `Project.file(Object)`.
      Returns:
        a property builder to further configure this property.