Artifact

public abstract class Artifact<T extends FileSystemLocation> implements Serializable

Known direct subclasses
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.

Known indirect subclasses
MultipleArtifact.MULTIDEX_KEEP_PROGUARD

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

MultipleArtifact.NATIVE_DEBUG_METADATA

Directories with native debug metadata

MultipleArtifact.NATIVE_SYMBOL_TABLES

Directories with debug symbol table

MultipleArtifact

Public Artifact for Android Gradle plugin.

ScopedArtifact.CLASSES

.class files, result of sources compilation and/or external dependencies depending on the scope

ScopedArtifact.JAVA_RES
ScopedArtifact

List of ScopedArtifacts.Scope artifacts.

SingleArtifact.AAR

The final AAR file as it would be published.

SingleArtifact.APK_FROM_BUNDLE

Universal APK that contains assets for all screen densities.

SingleArtifact.APK

Directory where APK files will be located.

SingleArtifact.ASSETS

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

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

The directory containing all the native library (.so) files that will be packaged in the APK, AAR, or Bundle.

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.

SingleArtifact

Public Artifact for Android Gradle plugin.


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 types

public interface Artifact.Appendable

Denotes an artifact type that can be appended to.

public enum Artifact.Category extends Enum

Defines the kind of artifact type. this will be used to determine the output file location for instance.

public interface Artifact.ContainsMany

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

public abstract class Artifact.Multiple<FileTypeT extends FileSystemLocation> extends Artifact

Denotes possible multiple FileSystemLocation instances for this artifact type.

public interface Artifact.Replaceable

Denotes an artifact type that can be replaced.

public abstract class Artifact.Single<FileTypeT extends FileSystemLocation> extends Artifact

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

public interface Artifact.Transformable

Denotes an artifact type that can transformed.

Public constructors

<T extends FileSystemLocation> Artifact(
    @NonNull ArtifactKind<@NonNull T> kind,
    @NonNull Artifact.Category category
)

Public methods

final @NonNull Artifact.Category
@NonNull String
@NonNull String
final @NonNull ArtifactKind<@NonNull T>
final @NonNull String

Provide a unique name for the artifact type.

Public fields

DIRECTORY

public static final @NonNull ArtifactKind.DIRECTORY DIRECTORY

ArtifactKind for Directory

FILE

public static final @NonNull ArtifactKind.FILE FILE

ArtifactKind for RegularFile

Public constructors

Artifact

public <T extends FileSystemLocation> Artifact(
    @NonNull ArtifactKind<@NonNull T> kind,
    @NonNull Artifact.Category category
)

Public methods

getCategory

public final @NonNull Artifact.Category getCategory()

getFileSystemLocationName

public @NonNull String getFileSystemLocationName()
Returns
@NonNull String

Depending on T, returns the file name of the folder under the variant-specific folder or an empty string to use defaults.

getFolderName

public @NonNull String getFolderName()
Returns
@NonNull String

The folder name under which the artifact files or folders should be stored.

getKind

public final @NonNull ArtifactKind<@NonNull T> getKind()

name

public final @NonNull String name()

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.