ScopedArtifactsOperation
interface ScopedArtifactsOperation<T : Task>
Defines all possible operations on a ScopedArtifact
artifact type.
Depending on the scope, inputs may contain a mix of org.gradle.api.file.FileCollection
, RegularFile
or Directory
so all Task
consuming the current value of the artifact must provide two input fields that will contain the list of RegularFile
and Directory
.
Summary
Public functions |
|
---|---|
Unit |
toAppend(to: ScopedArtifact, with: (T) -> Property<FileSystemLocation>) Append a new |
Unit |
toGet( Set the final version of the |
Unit |
toReplace(type: ScopedArtifact, into: (T) -> RegularFileProperty) Transform the current version of the |
Unit |
toTransform( Transform the current version of the |
Public functions
toAppend
fun toAppend(to: ScopedArtifact, with: (T) -> Property<FileSystemLocation>): Unit
Append a new FileSystemLocation
(basically, either a Directory
or a RegularFile
) to the artifact type referenced by to
Parameters | |
---|---|
to: ScopedArtifact |
the |
with: (T) -> Property<FileSystemLocation> |
lambda that returns the |
toGet
fun toGet(
type: ScopedArtifact,
inputJars: (T) -> ListProperty<RegularFile>,
inputDirectories: (T) -> ListProperty<Directory>
): Unit
Set the final version of the type
artifact to the input fields of the Task
. Those input fields should be annotated with org.gradle.api.tasks.InputFiles
for Gradle to property set the task dependency.
Parameters | |
---|---|
type: ScopedArtifact |
the |
inputJars: (T) -> ListProperty<RegularFile> |
lambda that returns a |
inputDirectories: (T) -> ListProperty<Directory> |
lambda that returns a |
toReplace
fun toReplace(type: ScopedArtifact, into: (T) -> RegularFileProperty): Unit
Transform the current version of the type
artifact into a new version. The order in which the replace Task
s are applied is directly set by the order of this method call. Last one wins and none of the previously set append/transform/replace registered Task
s will be invoked since this Task
replace the final version.
Parameters | |
---|---|
type: ScopedArtifact |
the |
into: (T) -> RegularFileProperty |
lambda that returns the |
toTransform
fun toTransform(
type: ScopedArtifact,
inputJars: (T) -> ListProperty<RegularFile>,
inputDirectories: (T) -> ListProperty<Directory>,
into: (T) -> RegularFileProperty
): Unit
Transform the current version of the type
artifact into a new version. The order in which the transforms are applied is directly set by the order of this method call. First come, first served, last one provides the final version of the artifacts.
Parameters | |
---|---|
type: ScopedArtifact |
the |
inputJars: (T) -> ListProperty<RegularFile> |
lambda that returns a |
inputDirectories: (T) -> ListProperty<Directory> |
lambda that returns a |
into: (T) -> RegularFileProperty |
lambda that returns the |