Interface TaskInputs

    • Method Detail

      • getHasInputs

        boolean getHasInputs()
        Returns true if this task has declared the inputs that it consumes.
        Returns:
        true if this task has declared any inputs.
      • getFiles

        FileCollection getFiles()
        Returns the input files of this task.
        Returns:
        The input files. Returns an empty collection if this task has no input files.
      • getProperties

        Map<String,​Object> getProperties()
        Returns the set of input properties for this task.
        Returns:
        The properties.
      • property

        TaskInputPropertyBuilder property​(String name,
                                          @Nullable
                                          Object value)

        Registers an input property for this task. This value is persisted when the task executes, and is compared against the property value for later invocations of the task, to determine if the task is up-to-date.

        The given value for the property must be Serializable, so that it can be persisted. It should also provide a useful equals() method.

        You can specify a closure or Callable as the value of the property. In which case, the closure or Callable is executed to determine the actual property value.

        Specified by:
        property in interface CompatibilityAdapterForTaskInputs
        Parameters:
        name - The name of the property. Must not be null.
        value - The value for the property. Can be null.
      • properties

        TaskInputs properties​(Map<String,​?> properties)
        Registers a set of input properties for this task. See property(String, Object) for details.

        Note: do not use the return value to chain calls. Instead always use call via Task.getInputs().

        Parameters:
        properties - The properties.
      • getHasSourceFiles

        boolean getHasSourceFiles()
        Returns true if this task has declared that it accepts source files.
        Returns:
        true if this task has source files, false if not.
      • getSourceFiles

        FileCollection getSourceFiles()
        Returns the set of source files for this task. These are the subset of input files which the task actually does work on. A task is skipped if it has declared it accepts source files, and this collection is empty.
        Returns:
        The set of source files for this task.