TaskBasedOperation

Added in 4.2.0

interface TaskBasedOperation<TaskT : 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 functions

OutOperationRequest<FileTypeT>
<FileTypeT : FileSystemLocation> wiredWith(
    taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>
)

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

CombiningOperationRequest<FileTypeT>
<FileTypeT : FileSystemLocation> wiredWith(
    taskInput: (TaskT) -> ListProperty<FileTypeT>,
    taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>
)

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.

InAndOutDirectoryOperationRequest<TaskT>
wiredWithDirectories(
    taskInput: (TaskT) -> DirectoryProperty,
    taskOutput: (TaskT) -> DirectoryProperty
)

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

InAndOutFileOperationRequest
wiredWithFiles(
    taskInput: (TaskT) -> RegularFileProperty,
    taskOutput: (TaskT) -> RegularFileProperty
)

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

MultipleArtifactTypeOutOperationRequest<FileTypeT>
<FileTypeT : FileSystemLocation> wiredWithMultiple(
    taskInput: (TaskT) -> ListProperty<FileTypeT>
)

Sets the TaskT input method reference so the TaskT can be retrieve the current version of the target MultipleArtifact when invoking taskInput.

Public functions

wiredWith

Added in 4.2.0
fun <FileTypeT : FileSystemLocation> wiredWith(
    taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>
): OutOperationRequest<FileTypeT>

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
taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>

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

Returns
OutOperationRequest<FileTypeT>

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

wiredWith

Added in 4.2.0
fun <FileTypeT : FileSystemLocation> wiredWith(
    taskInput: (TaskT) -> ListProperty<FileTypeT>,
    taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>
): CombiningOperationRequest<FileTypeT>

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
taskInput: (TaskT) -> ListProperty<FileTypeT>

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

taskOutput: (TaskT) -> FileSystemLocationProperty<FileTypeT>

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

Returns
CombiningOperationRequest<FileTypeT>

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

wiredWithDirectories

fun wiredWithDirectories(
    taskInput: (TaskT) -> DirectoryProperty,
    taskOutput: (TaskT) -> DirectoryProperty
): InAndOutDirectoryOperationRequest<TaskT>

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
taskInput: (TaskT) -> DirectoryProperty

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

taskOutput: (TaskT) -> DirectoryProperty

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

Returns
InAndOutDirectoryOperationRequest<TaskT>

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

wiredWithFiles

fun wiredWithFiles(
    taskInput: (TaskT) -> RegularFileProperty,
    taskOutput: (TaskT) -> RegularFileProperty
): InAndOutFileOperationRequest

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
taskInput: (TaskT) -> RegularFileProperty

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

taskOutput: (TaskT) -> RegularFileProperty

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

Returns
InAndOutFileOperationRequest

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

wiredWithMultiple

Added in 8.3.1
fun <FileTypeT : FileSystemLocation> wiredWithMultiple(
    taskInput: (TaskT) -> ListProperty<FileTypeT>
): MultipleArtifactTypeOutOperationRequest<FileTypeT>

Sets the TaskT input method reference so the TaskT can be retrieve the current version of the target MultipleArtifact when invoking taskInput.

Parameters
taskInput: (TaskT) -> ListProperty<FileTypeT>

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

Returns
MultipleArtifactTypeOutOperationRequest<FileTypeT>

the MultipleArtifactTypeOutOperationRequest to set the desired operation type and the target MultipleArtifact