ScopedArtifactsOperation

public interface ScopedArtifactsOperation<T extends 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 methods

abstract void
toAppend(
    @NonNull ScopedArtifact to,
    @NonNull Function1<@NonNull T, @NonNull Property<@NonNull FileSystemLocation>> with
)

Append a new FileSystemLocation (basically, either a Directory or a RegularFile) to the artifact type referenced by to

abstract void
toGet(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories
)

Set the final version of the type artifact to the input fields of the Task.

abstract void
toReplace(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into
)

Transform the current version of the type artifact into a new version.

abstract void
toTransform(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories,
    @NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into
)

Transform the current version of the type artifact into a new version.

Public methods

toAppend

abstract void toAppend(
    @NonNull ScopedArtifact to,
    @NonNull Function1<@NonNull T, @NonNull Property<@NonNull FileSystemLocation>> with
)

Append a new FileSystemLocation (basically, either a Directory or a RegularFile) to the artifact type referenced by to

Parameters
@NonNull ScopedArtifact to

the ScopedArtifact to add the with to.

@NonNull Function1<@NonNull T, @NonNull Property<@NonNull FileSystemLocation>> with

lambda that returns the Property used by the Task to save the appended element. The Property value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future.

toGet

abstract void toGet(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories
)

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
@NonNull ScopedArtifact type

the ScopedArtifact to obtain the final value of.

@NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars

lambda that returns a ListProperty or RegularFile that will be used to set all incoming files for this artifact type.

@NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories

lambda that returns a ListProperty or Directory that will be used to set all incoming directories for this artifact type.

toReplace

abstract void toReplace(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into
)

Transform the current version of the type artifact into a new version. The order in which the replace Tasks 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 Tasks will be invoked since this Task replace the final version.

Parameters
@NonNull ScopedArtifact type

the ScopedArtifact to replace.

@NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into

lambda that returns the Property used by the Task to save the replaced element. The Property value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future.

toTransform

abstract void toTransform(
    @NonNull ScopedArtifact type,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars,
    @NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories,
    @NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into
)

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
@NonNull ScopedArtifact type

the ScopedArtifact to transform.

@NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull RegularFile>> inputJars

lambda that returns a ListProperty or RegularFile that will be used to set all incoming files for this artifact type.

@NonNull Function1<@NonNull T, @NonNull ListProperty<@NonNull Directory>> inputDirectories

lambda that returns a ListProperty or Directory that will be used to set all incoming directories for this artifact type.

@NonNull Function1<@NonNull T, @NonNull RegularFileProperty> into

lambda that returns the Property used by the Task to save the transformed element. The Property value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future.