# ManifestFiles

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


```
interface ManifestFiles : Named
```

<br />

*** ** * ** ***

Defines a set of manifests for particular variant. Adding manifest is always added static and generated manifests carry the highest possible priority across all manifests.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `<TASK : https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html> https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addGeneratedManifestFile(org.gradle.api.tasks.TaskProvider,kotlin.Function1)( taskProvider: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskProvider.html<TASK>, wiredWith: (TASK) -> https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html )` Add the output of a custom task to the list of manifests. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addStaticManifestFile(kotlin.String)(relativeFilePath: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Add existing manifest file to the variant. |

| ### Public properties |
|---|---|
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html>>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#all()` Get all registered manifests as a `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html` of `https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html`. |

### Inherited properties

From [org.gradle.api.Named](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html#name`

## Public functions

### addGeneratedManifestFile

```
fun <TASK : Task> addGeneratedManifestFile(
    taskProvider: TaskProvider<TASK>,
    wiredWith: (TASK) -> RegularFileProperty
): Unit
```

Add the output of a custom task to the list of manifests.

The `https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html` is the output of a Task `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addGeneratedManifestFile(org.gradle.api.tasks.TaskProvider,kotlin.Function1)` that has been registered using the Gradle's Task manager.

The manifest is added last to the variant's list and has the highest priority.

| Parameters |
|---|---|
| `taskProvider: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskProvider.html<TASK>` | the `https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskProvider.html` returned by Gradle's Task manager when registering the Task of type `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addGeneratedManifestFile(org.gradle.api.tasks.TaskProvider,kotlin.Function1)`. |
| `wiredWith: (TASK) -> https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html` | the method reference returning the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addGeneratedManifestFile(org.gradle.api.tasks.TaskProvider,kotlin.Function1)` task's output to use as a source directory. The generated manifest location is automatically determined by the Android Gradle Plugin |

### addStaticManifestFile

Added in 8.3.1

```
fun addStaticManifestFile(relativeFilePath: String): Unit
```

Add existing manifest file to the variant.

The file will be added last in the list of manifest files for the variant. As long as there is a manifest merging process, added manifest will overlay others and become the one with the highest priority.

Do not use `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addStaticManifestFile(kotlin.String)` to add sources that are generated by a task, instead use `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ManifestFiles#addGeneratedManifestFile(org.gradle.api.tasks.TaskProvider,kotlin.Function1)`

| Parameters |
|---|---|
| `relativeFilePath: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the manifest file path, that will be resolved using the `https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html#file-java.lang.String-` API relative to the Gradle project directory. |

## Public properties

### all

Added in 8.3.1

```
val all: Provider<List<RegularFile>>
```

Get all registered manifests as a `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html` of `https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html`.

The outer `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html` represents the priority of manifests respective to each other, meaning that elements first in the list overrides elements last in the list.

The returned `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html` can be used directly in a `https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/InputFiles.html` annotated property of a `https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html`