# Artifact

# Artifact

[View Source](https://cs.android.com/search?q=file:com/android/build/api/artifact/Artifact.kt+class:com.android.build.api.artifact.Artifact)  
Added in 4.2.0  

<br />

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

<br />

Known direct subclasses  
[Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Multiple),[Artifact.Single](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Single)  

|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/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.MULTIDEX_KEEP_PROGUARD](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact.MULTIDEX_KEEP_PROGUARD),[MultipleArtifact.NATIVE_DEBUG_METADATA](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact.NATIVE_DEBUG_METADATA),[MultipleArtifact.NATIVE_SYMBOL_TABLES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact.NATIVE_SYMBOL_TABLES),[MultipleArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact),[ScopedArtifact.CLASSES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact.CLASSES),[ScopedArtifact.JAVA_RES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact.JAVA_RES),[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact),[SingleArtifact.AAR](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.AAR),[SingleArtifact.APK_FROM_BUNDLE](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.APK_FROM_BUNDLE),[SingleArtifact.APK](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.APK),[SingleArtifact.ASSETS](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.ASSETS),[SingleArtifact.BUNDLE](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.BUNDLE),[SingleArtifact.MERGED_MANIFEST](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.MERGED_MANIFEST),[SingleArtifact.MERGED_NATIVE_LIBS](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.MERGED_NATIVE_LIBS),[SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.METADATA_LIBRARY_DEPENDENCIES_REPORT),[SingleArtifact.OBFUSCATION_MAPPING_FILE](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.OBFUSCATION_MAPPING_FILE),[SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST),[SingleArtifact.RUNTIME_SYMBOL_LIST](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.RUNTIME_SYMBOL_LIST),[SingleArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact)  

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MultipleArtifact.MULTIDEX_KEEP_PROGUARD](https://developer.android.com/reference/tools/gradle-api/8.12/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.                                                         |
| [MultipleArtifact.NATIVE_DEBUG_METADATA](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact.NATIVE_DEBUG_METADATA)                           | Directories with native debug metadata                                                                                                                                       |
| [MultipleArtifact.NATIVE_SYMBOL_TABLES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact.NATIVE_SYMBOL_TABLES)                             | Directories with debug symbol table                                                                                                                                          |
| [MultipleArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/MultipleArtifact)                                                                       | Public[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact)for Android Gradle plugin.                            |
| [ScopedArtifact.CLASSES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact.CLASSES)                                                           | .class files, result of sources compilation and/or external dependencies depending on the scope; includes users' transformation, but does not include Jacoco instrumentation |
| [ScopedArtifact.JAVA_RES](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact.JAVA_RES)                                                         |                                                                                                                                                                              |
| [ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ScopedArtifact)                                                                           | List of ScopedArtifacts.Scope artifacts.                                                                                                                                     |
| [SingleArtifact.AAR](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.AAR)                                                                   | The final AAR file as it would be published.                                                                                                                                 |
| [SingleArtifact.APK_FROM_BUNDLE](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.APK_FROM_BUNDLE)                                           | Universal APK that contains assets for all screen densities.                                                                                                                 |
| [SingleArtifact.APK](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.APK)                                                                   | Directory where APK files will be located.                                                                                                                                   |
| [SingleArtifact.ASSETS](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.ASSETS)                                                             | Assets that will be packaged in the resulting AAR, APK or Bundle.                                                                                                            |
| [SingleArtifact.BUNDLE](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/com/android/build/api/artifact/SingleArtifact.MERGED_MANIFEST)                                           | Merged manifest file that will be used in the APK, Bundle and InstantApp packages.                                                                                           |
| [SingleArtifact.MERGED_NATIVE_LIBS](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/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](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/com/android/build/api/artifact/SingleArtifact.OBFUSCATION_MAPPING_FILE)                         |                                                                                                                                                                              |
| [SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST)               | A file containing the list of public resources exported by a library project.                                                                                                |
| [SingleArtifact.RUNTIME_SYMBOL_LIST](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact.RUNTIME_SYMBOL_LIST)                                   | The text symbol output file (R.txt) containing a list of resources and their ids (including of transitive dependencies).                                                     |
| [SingleArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/SingleArtifact)                                                                           | Public[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact)for Android Gradle plugin.                            |

*** ** * ** ***

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

Each instance of[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/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/8.12/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 types                                                                                                                                                                                                                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `interface `[Artifact.Appendable](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Appendable) Denotes an artifact type that can be appended to.                                                                                                                                                                                                                                                                                                                                                                    |
| `enum `[Artifact.Category](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Category)` : `[Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html) Defines the kind of artifact type. this will be used to determine the output file location for instance.                                                                                                                                                                                                                                     |
| `interface `[Artifact.ContainsMany](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.ContainsMany) Denotes a single[DIRECTORY](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#DIRECTORY())that may contain zero to many[com.android.build.api.variant.BuiltArtifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/BuiltArtifact).                                                                             |
| `abstract class `[Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Multiple)`<FileTypeT : `[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)`> : `[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact) Denotes possible multiple[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)instances for this artifact type.  |
| `interface `[Artifact.Replaceable](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Replaceable) Denotes an artifact type that can be replaced.                                                                                                                                                                                                                                                                                                                                                                     |
| `abstract class `[Artifact.Single](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Single)`<FileTypeT : `[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)`> : `[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact) 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. |
| `interface `[Artifact.Transformable](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Transformable) Denotes an artifact type that can transformed.                                                                                                                                                                                                                                                                                                                                                                 |

|                                                        ### Public companion properties                                                        |
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ArtifactKind.DIRECTORY](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ArtifactKind.DIRECTORY) | [DIRECTORY](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#DIRECTORY()) [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/com/android/build/api/artifact/ArtifactKind.FILE)           | [FILE](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#FILE()) [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ArtifactKind)for[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)       |

|                                                                                                                                                                                                                                                                                                            ### Public constructors                                                                                                                                                                                                                                                                                                            |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<T : `[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)`> `[Artifact](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#Artifact(com.android.build.api.artifact.ArtifactKind,com.android.build.api.artifact.Artifact.Category))`(` ` kind: `[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ArtifactKind)`<T>,` ` category: `[Artifact.Category](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Category) `)` |

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

|                                                        ### Public properties                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| [Artifact.Category](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact.Category) | [category](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#category()) |
| [ArtifactKind](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/ArtifactKind)`<T>`      | [kind](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact#kind())         |

## Public companion properties

### DIRECTORY

```
val DIRECTORY: ArtifactKind.DIRECTORY
```

[ArtifactKind](https://developer.android.com/reference/tools/gradle-api/8.12/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/8.12/com/android/build/api/artifact/ArtifactKind)for[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)  

## Public constructors

### Artifact

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

## Public functions

### getFileSystemLocationName

Added in 4.2.0  

```
open fun getFileSystemLocationName(): String
```  

|                                     Returns                                      |
|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | Depending on[T](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/artifact/Artifact), returns the file name of the folder under the variant-specific folder or an empty string to use defaults. |

### getFolderName

Added in 4.2.0  

```
open fun getFolderName(): String
```  

|                                     Returns                                      |
|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | The folder name under which the artifact files or folders should be stored. |

### name

Added in 4.2.0  

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

## Public properties

### category

Added in 4.2.0  

```
val category: Artifact.Category
```  

### kind

Added in 4.2.0  

```
val kind: ArtifactKind<T>
```