# SourceDirectories.Flat

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


```
interface SourceDirectories.Flat : SourceDirectories
```

<br />

*** ** * ** ***

Represents all the source folders for a source type.

All folders are considered of the same priority, so if there is a conflict (e.g, two files with the same relative path and name), it will require a resolution step like merging to ensure nothing gets lost.

## Summary

| ### Public properties |
|---|---|
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html<https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html>>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/SourceDirectories.Flat#all()` Get all registered source folders and files 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/Directory.html`. |
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html<https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html>>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/SourceDirectories.Flat#static()` Get all registered static file folders (non generated by a Task) 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/Directory.html`. |

### Inherited functions

From [com.android.build.api.variant.SourceDirectories](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/SourceDirectories) `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/SourceDirectories#addGeneratedSourceDirectory(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/DirectoryProperty.html
)`

Add the output of a custom task to the list of source directories.
`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/SourceDirectories#addStaticSourceDirectory(kotlin.String)(srcDir: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`

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

### 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 properties

### all

```
val all: Provider<Collection<Directory>>
```

Get all registered source folders and files 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/Directory.html`.

Some source types do not have the concept of overriding, while others require a merging step to ensure only one source file is used when processing begins.

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`

### static

Added in 8.4.0

```
val static: Provider<Collection<Directory>>
```

Get all registered static file folders (non generated by a Task) 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/Directory.html`.

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`