ManifestFiles

public interface ManifestFiles extends Named


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 methods

abstract void
<TASK extends Task> addGeneratedManifestFile(
    @NonNull TaskProvider<@NonNull TASK> taskProvider,
    @NonNull Function1<@NonNull TASK, @NonNull RegularFileProperty> wiredWith
)

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

abstract void

Add existing manifest file to the variant.

abstract @NonNull Provider<@NonNull List<@NonNull RegularFile>>

Get all registered manifests as a List of RegularFile.

Inherited methods

From org.gradle.api.Named
abstract @NonNull String

Public methods

addGeneratedManifestFile

abstract void <TASK extends Task> addGeneratedManifestFile(
    @NonNull TaskProvider<@NonNull TASK> taskProvider,
    @NonNull Function1<@NonNull TASK, @NonNull RegularFileProperty> wiredWith
)

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

The RegularFileProperty is the output of a Task TASK 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
@NonNull TaskProvider<@NonNull TASK> taskProvider

the TaskProvider returned by Gradle's Task manager when registering the Task of type TASK.

@NonNull Function1<@NonNull TASK, @NonNull RegularFileProperty> wiredWith

the method reference returning the TASK task's output to use as a source directory. The generated manifest location is automatically determined by the Android Gradle Plugin

addStaticManifestFile

abstract void addStaticManifestFile(@NonNull String relativeFilePath)

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 addStaticManifestFile to add sources that are generated by a task, instead use addGeneratedManifestFile

Parameters
@NonNull String relativeFilePath

the manifest file path, that will be resolved using the Directory.file API relative to the Gradle project directory.

getAll

abstract @NonNull Provider<@NonNull List<@NonNull RegularFile>> getAll()

Get all registered manifests as a List of RegularFile.

The outer List represents the priority of manifests respective to each other, meaning that elements first in the list overrides elements last in the list.

The returned Provider can be used directly in a org.gradle.api.tasks.InputFiles annotated property of a Task