public interface SourceDirectories.Layered extends SourceDirectories

Represent a collection of directories that have overlay properties to each other. This mean that some directories will carry higher priority when merging content will be carried out.

The collection is represented as a List where the first elements are the highest priority ones.

For a specific priority, there can be more than one directory defined and is represented as a Collection of Directory.

Therefore, Layered can be represented as a List of Collection of Directory.


Public methods

abstract @NonNull Provider<@NonNull List<@NonNull Collection<@NonNull Directory>>>

Get all registered source folders and files as a List of Collection of Directory.

Inherited methods

From org.gradle.api.Named
abstract @NonNull String
abstract void
<TASK extends Task> addGeneratedSourceDirectory(
    @NonNull TaskProvider<@NonNull TASK> taskProvider,
    @NonNull Function1<@NonNull TASK, @NonNull DirectoryProperty> wiredWith

Add the output of a custom task to the list of source directories.

abstract void

Add a source directory with sources already present to the variant.

Public methods


abstract @NonNull Provider<@NonNull List<@NonNull Collection<@NonNull Directory>>> getAll()

Get all registered source folders and files as a List of Collection of Directory.

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

The inner Collection represents all Directory with the same priority respective to each other.

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