Artifact

abstract class Artifact<T : FileSystemLocation> : Serializable
Artifact.Multiple

Denotes possible multiple FileSystemLocation instances for this artifact type.

Artifact.Single

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

MultipleArtifact

Public Artifact for Android Gradle plugin.

MultipleArtifact.ALL_CLASSES_DIRS

Classes that will eventually be dex'ed for this module, that were generated, or processed as directories.

MultipleArtifact.ALL_CLASSES_JARS

Classes that will eventually be dex'ed for this module, that were generated, or processed as jar files.

MultipleArtifact.ASSETS

Assets that will be packaged in the resulting APK or Bundle.

MultipleArtifact.MULTIDEX_KEEP_PROGUARD

Text files with additional ProGuard rules to be used to determine which classes are compiled into the main dex file.

SingleArtifact

Public Artifact for Android Gradle plugin.

SingleArtifact.AAR

The final AAR file as it would be published.

SingleArtifact.APK

Directory where APK files will be located.

SingleArtifact.BUNDLE

The final Bundle ready for consumption at Play Store.

SingleArtifact.MERGED_MANIFEST

Merged manifest file that will be used in the APK, Bundle and InstantApp packages.

SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT

The metadata for the library dependencies.

SingleArtifact.OBFUSCATION_MAPPING_FILE

SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST

A file containing the list of public resources exported by a library project.

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 Multiple 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.

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 Multiple 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