# Artifact

# Artifact

```
abstract class Artifact<T : FileSystemLocation> : Serializable
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                   ||
| ↳ | [com.android.build.api.artifact.Artifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#) |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Multiple),[Artifact.Single](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Single) |------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Multiple) | Denotes possible multiple[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)instances for this artifact type.      | | [Artifact.Single](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Single)     | Denotes a single[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)instance of this artifact type at a given time. | |

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Indirect Subclasses [MultipleArtifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact),[MultipleArtifact.ALL_CLASSES_DIRS](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.ALL_CLASSES_DIRS),[MultipleArtifact.ALL_CLASSES_JARS](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.ALL_CLASSES_JARS),[MultipleArtifact.ASSETS](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.ASSETS),[MultipleArtifact.MULTIDEX_KEEP_PROGUARD](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.MULTIDEX_KEEP_PROGUARD),[SingleArtifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact),[SingleArtifact.AAR](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.AAR),[SingleArtifact.APK](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.APK),[SingleArtifact.BUNDLE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.BUNDLE),[SingleArtifact.MERGED_MANIFEST](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.MERGED_MANIFEST),[SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT),[SingleArtifact.OBFUSCATION_MAPPING_FILE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.OBFUSCATION_MAPPING_FILE), and 1 others. |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------| | [MultipleArtifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact)                                                                       | Public[Artifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#)for Android Gradle plugin. | | [MultipleArtifact.ALL_CLASSES_DIRS](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.ALL_CLASSES_JARS)                                     | Classes that will eventually be dex'ed for this module, that were generated, or processed as jar files.                                           | | [MultipleArtifact.ASSETS](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/MultipleArtifact.ASSETS)                                                         | Assets that will be packaged in the resulting APK or Bundle.                                                                                      | | [MultipleArtifact.MULTIDEX_KEEP_PROGUARD](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact)                                                                           | Public[Artifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#)for Android Gradle plugin. | | [SingleArtifact.AAR](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.AAR)                                                                   | The final AAR file as it would be published.                                                                                                      | | [SingleArtifact.APK](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.APK)                                                                   | Directory where APK files will be located.                                                                                                        | | [SingleArtifact.BUNDLE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.BUNDLE)                                                             | The final Bundle ready for consumption at Play Store.                                                                                             | | [SingleArtifact.MERGED_MANIFEST](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.MERGED_MANIFEST)                                           | Merged manifest file that will be used in the APK, Bundle and InstantApp packages.                                                                | | [SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT) | The metadata for the library dependencies.                                                                                                        | | [SingleArtifact.OBFUSCATION_MAPPING_FILE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/SingleArtifact.OBFUSCATION_MAPPING_FILE)                         | <br />                                                                                                                                            | | [SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#)is produced by a[org.gradle.api.Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Multiple)interface will indicate such requirement.

An artifact must be one of the supported[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)and must be provided when the constructor is called. ArtifactKind also defines the specific[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)subclass used.

## Summary

|                                                                                                                                                                                                                                                                 ### Nested classes                                                                                                                                                                                                                                                                 ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract | [Appendable](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Appendable) Denotes an artifact type that can be appended to.                                                                                                                                                                                                                                                                                                                                                          |
| enum     | [Category](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Category) Defines the kind of artifact type.                                                                                                                                                                                                                                                                                                                                                                             |
| abstract | [ContainsMany](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.ContainsMany) Denotes a single[DIRECTORY](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#Companion.DIRECTORY:com.android.build.api.artifact.ArtifactKind.DIRECTORY)that may contain zero to many[com.android.build.api.variant.BuiltArtifact](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/BuiltArtifact.html#). |
| abstract | [Multiple](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Multiple) Denotes possible multiple[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)instances for this artifact type.                                                                                                                                                                                                                                            |
| abstract | [Replaceable](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Replaceable) Denotes an artifact type that can be replaced.                                                                                                                                                                                                                                                                                                                                                           |
| abstract | [Single](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Single) Denotes a single[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)instance of this artifact type at a given time.                                                                                                                                                                                                                                           |
| abstract | [Transformable](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Transformable) Denotes an artifact type that can transformed.                                                                                                                                                                                                                                                                                                                                                       |

|                                                                                                                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [<init>](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#%3Cinit%3E(com.android.build.api.artifact.ArtifactKind,%20com.android.build.api.artifact.Artifact.Category))`(`kind:` `[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)<T>`, `category:` `[Artifact.Category](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Category)`)` Defines a type of artifact handled by the Android Gradle Plugin. |

|                                                                                                                       ### Public methods                                                                                                                       ||
|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getFileSystemLocationName](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#getFileSystemLocationName())`()` <br /> |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getFolderName](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#getFolderName())`()` <br />                         |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)     | [name](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#name())`()` Provide a unique name for the artifact type.     |

|                                                                                                                                                    ### Properties                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Artifact.Category](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Category) | [category](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#category:com.android.build.api.artifact.Artifact.Category) <br /> |
| [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)\<T\>      | [kind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#kind:com.android.build.api.artifact.ArtifactKind) <br />              |

|                                                                                                                                                                                                                                                                   ### Companion properties                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ArtifactKind.DIRECTORY](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind.DIRECTORY) | [DIRECTORY](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#Companion.DIRECTORY:com.android.build.api.artifact.ArtifactKind.DIRECTORY) [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)for[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html) |
| [ArtifactKind.FILE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind.FILE)           | [FILE](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#Companion.FILE:com.android.build.api.artifact.ArtifactKind.FILE) [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)for[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)            |

## 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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact#)is produced by a[org.gradle.api.Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifact.Multiple)interface will indicate such requirement.

An artifact must be one of the supported[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)and must be provided when the constructor is called. ArtifactKind also defines the specific[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)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](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)for[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)  

### FILE

```
val FILE: ArtifactKind.FILE
```

[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/ArtifactKind)for[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)