Google is committed to advancing racial equity for Black communities. See how.

Artifact

@Incubating abstract class Artifact<T : FileSystemLocation> : Serializable
kotlin.Any
   ↳ com.android.build.api.artifact.Artifact

Defines a type of artifact handled by the Android Gradle Plugin.

Each instance of Artifact is produced by a org.gradle.api.Task and potentially consumed by any number of tasks.

An artifact can potentially be produced by more than one task (each task acting in an additive behavior), but consumers must be aware when more than one artifact can be present, implementing the MultipleArtifact interface will indicate such requirement.

An artifact must be one of the supported ArtifactKind and must be provided when the constructor is called. ArtifactKind also defines the specific FileSystemLocation subclass used.

Summary

Nested classes

abstract

Denotes an artifact type that can be appended to.

enum

Defines the kind of artifact type.

abstract

Denotes a single DIRECTORY that may contain zero to many com.android.build.api.variant.BuiltArtifact.

abstract

Denotes possible multiple FileSystemLocation instances for this artifact type.

abstract

Denotes an artifact type that can be replaced.

abstract

Denotes a single FileSystemLocation instance of this artifact type at a given time.

abstract

Denotes an artifact type that can transformed.

Public constructors

<init>(kind: ArtifactKind<T>, category: Artifact.Category)

Defines a type of artifact handled by the Android Gradle Plugin.

Public methods

open String

open String

String

Provide a unique name for the artifact type.

Properties

Artifact.Category

ArtifactKind<T>

Companion properties

ArtifactKind.DIRECTORY

ArtifactKind for Directory

ArtifactKind.FILE

ArtifactKind for RegularFile

Public constructors

<init>

Artifact(
    kind: ArtifactKind<T>,
    category: Artifact.Category)

Defines a type of artifact handled by the Android Gradle Plugin.

Each instance of Artifact is produced by a org.gradle.api.Task and potentially consumed by any number of tasks.

An artifact can potentially be produced by more than one task (each task acting in an additive behavior), but consumers must be aware when more than one artifact can be present, implementing the MultipleArtifact interface will indicate such requirement.

An artifact must be one of the supported ArtifactKind and must be provided when the constructor is called. ArtifactKind also defines the specific FileSystemLocation subclass used.

Public methods

getFileSystemLocationName

open fun getFileSystemLocationName(): String
Return
Depending on T, returns the file name of the folder under the variant-specific folder or an empty string to use defaults.

getFolderName

open fun getFolderName(): String
Return
The folder name under which the artifact files or folders should be stored.

name

fun name(): String

Provide a unique name for the artifact type. For external plugins defining new types, consider adding the plugin name to the artifact's name to avoid collision with other plugins.

Properties

category

val category: Artifact.Category

kind

val kind: ArtifactKind<T>

Companion properties

DIRECTORY

val DIRECTORY: ArtifactKind.DIRECTORY

ArtifactKind for Directory