TaskBasedOperation

public interface TaskBasedOperation<TaskT extends Task>


Interface with methods to wire input and output method references to Task-based operations.

A Task-based operation will create, transform, or append files or directories to public SingleArtifact to customize or participate in the build flow.

Each operation should indicate through the methods of this interface which method can be used to set or retrieve the Task inputs and outputs.

Summary

Public methods

abstract @NonNull OutOperationRequest<@NonNull FileTypeT>
<FileTypeT extends FileSystemLocation> wiredWith(
    @NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput
)

Sets the TaskT output method reference so the TaskT result can be retrieved after successful task execution.

abstract @NonNull CombiningOperationRequest<@NonNull FileTypeT>
<FileTypeT extends FileSystemLocation> wiredWith(
    @NonNull Function1<@NonNull TaskT, @NonNull ListProperty<@NonNull FileTypeT>> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current versions of a Artifact.Multiple when invoking taskInput while producing a new version of the same artifact type accessible through the taskOutput method after successful execution.

abstract @NonNull InAndOutDirectoryOperationRequest<@NonNull TaskT>
wiredWithDirectories(
    @NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current version of the target SingleArtifact when invoking taskInput.

abstract @NonNull InAndOutFileOperationRequest
wiredWithFiles(
    @NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current version of the target SingleArtifact when invoking taskInput.

Public methods

wiredWith

abstract @NonNull OutOperationRequest<@NonNull FileTypeT> <FileTypeT extends FileSystemLocation> wiredWith(
    @NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput
)

Sets the TaskT output method reference so the TaskT result can be retrieved after successful task execution.

This method is useful when creating a new version, when appending to existing artifacts, or when access to the current version of an artifact isn't required.

Parameters
@NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput

The method reference to retrieve the task output after successful task execution.

Returns
@NonNull OutOperationRequest<@NonNull FileTypeT>

The OutOperationRequest to set the desired operation type and SingleArtifact on which the operation applies.

wiredWith

abstract @NonNull CombiningOperationRequest<@NonNull FileTypeT> <FileTypeT extends FileSystemLocation> wiredWith(
    @NonNull Function1<@NonNull TaskT, @NonNull ListProperty<@NonNull FileTypeT>> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current versions of a Artifact.Multiple when invoking taskInput while producing a new version of the same artifact type accessible through the taskOutput method after successful execution.

This method is useful when TaskT is combining all elements of an SingleArtifact into a single element.

Parameters
@NonNull Function1<@NonNull TaskT, @NonNull ListProperty<@NonNull FileTypeT>> taskInput

The method reference the TaskT will use to retrieve the current artifact versions during TaskT execution (and only then).

@NonNull Function1<@NonNull TaskT, @NonNull FileSystemLocationProperty<@NonNull FileTypeT>> taskOutput

The method reference to retrieve the task output after successful task execution.

Returns
@NonNull CombiningOperationRequest<@NonNull FileTypeT>

The CombiningOperationRequest to set the desired operation type and SingleArtifact as well as the target SingleArtifact.

wiredWithDirectories

abstract @NonNull InAndOutDirectoryOperationRequest<@NonNull TaskT> wiredWithDirectories(
    @NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current version of the target SingleArtifact when invoking taskInput. TaskT will also produce a new version of the same artifact type accessible through the taskOutput method after successful execution.

This method is useful when TaskT is transforming an SingleArtifact from its current version to a new one and the SingleArtifact's Artifact.kind is Artifact.DIRECTORY

Parameters
@NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskInput

The method reference the TaskT will use to retrieve the current artifact version during TaskT execution (and only then).

@NonNull Function1<@NonNull TaskT, @NonNull DirectoryProperty> taskOutput

The method reference to retrieve the task output after successful task execution.

Returns
@NonNull InAndOutDirectoryOperationRequest<@NonNull TaskT>

The InAndOutDirectoryOperationRequest to set the desired operation type as well as the target SingleArtifact.

wiredWithFiles

abstract @NonNull InAndOutFileOperationRequest wiredWithFiles(
    @NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskInput,
    @NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskOutput
)

Sets the TaskT input and output methods references so the Task can retrieve the current version of the target SingleArtifact when invoking taskInput. TaskT will also produce a new version of the same artifact type accessible through the taskOutput method after successful execution.

This method is useful when TaskT is transforming an SingleArtifact from its current version to a new one and the SingleArtifact's Artifact.kind is Artifact.FILE

Parameters
@NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskInput

The method reference the TaskT will use to retrieve the current artifact version during TaskT execution (and only then).

@NonNull Function1<@NonNull TaskT, @NonNull RegularFileProperty> taskOutput

The method reference to retrieve the task output after successful task execution.

Returns
@NonNull InAndOutFileOperationRequest

The OutOperationRequest to set the desired operation type and SingleArtifact as well as the target SingleArtifact.