# Sources

# Sources


```
public interface Sources
```

<br />

*** ** * ** ***

Provides access to all source directories for a [Variant](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Variant).

## Summary

|                                                                                                                           ### Public methods                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | [getAidl](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getAidl())`()` Access to the aidl sources folders if [com.android.build.api.dsl.BuildFeatures.aidl](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#aidl()) is true otherwise null                                                                                                                                                                                                                                                                                                                                        |
| `abstract `[SourceDirectories.Layered](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Layered)                                                                                                       | [getAssets](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getAssets())`()` Access to the Android assets sources folders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | [getBaselineProfiles](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getBaselineProfiles())`()` Access to the Baseline profiles source folders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [getByName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getByName(kotlin.String))`(@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)` name)` Access (and potentially creates) a new Flat for a custom source type that can be referenced by its [name](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getByName(kotlin.String)). |
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | [getJava](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getJava())`()` Access to the Java source folders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `abstract `[SourceDirectories.Layered](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Layered)                                                                                                       | [getJniLibs](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getJniLibs())`()` Access to the JNI libraries folders                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [getKotlin](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getKotlin())`()` Access to the Kotlin source folders.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[ManifestFiles](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/ManifestFiles)                   | [getManifests](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getManifests())`()` Access to all android manifest files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `abstract `[SourceDirectories.Layered](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Layered)                                                                                                       | [getMlModels](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getMlModels())`()` Access to the machine learning models folders if [com.android.build.api.dsl.ApplicationBuildFeatures.mlModelBinding](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/ApplicationBuildFeatures#mlModelBinding()) is true otherwise null                                                                                                                                                                                                                                                                           |
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | [getRenderscript](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getRenderscript())`()` Access to the renderscript sources folders if [com.android.build.api.dsl.BuildFeatures.renderScript](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#renderScript()) is true otherwise null.                                                                                                                                                                                                                                                                                               |
| `abstract `[SourceDirectories.Layered](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Layered)                                                                                                       | [getRes](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getRes())`()` Access to the Android resources sources folders if the component supports android resources or if [com.android.build.api.dsl.LibraryBuildFeatures.androidResources](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/LibraryBuildFeatures#androidResources()) is true for library variants, otherwise null.                                                                                                                                                                                                                 |
| `abstract `[SourceDirectories.Flat](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Flat)                                                                                                             | [getResources](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getResources())`()` Access to the Java-style resources sources folders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `abstract `[SourceDirectories.Layered](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/SourceDirectories.Layered)                                                                                                       | [getShaders](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getShaders())`()` Access to the shaders sources folders if [com.android.build.api.dsl.BuildFeatures.shaders](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#shaders()) is true otherwise null                                                                                                                                                                                                                                                                                                                         |

## Public methods

### getAidl

```
abstract SourceDirectories.Flat getAidl()
```

Access to the aidl sources folders if [com.android.build.api.dsl.BuildFeatures.aidl](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#aidl()) is true otherwise null  

### getAssets

```
abstract SourceDirectories.Layered getAssets()
```

Access to the Android assets sources folders.  

### getBaselineProfiles

```
abstract SourceDirectories.Flat getBaselineProfiles()
```

Access to the Baseline profiles source folders.  

### getByName

```
@Incubating
abstract @NonNull SourceDirectories.Flat getByName(@NonNull String name)
```

Access (and potentially creates) a new Flat for a custom source type that can be referenced by its [name](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getByName(kotlin.String)).

The first caller will create the new instance, other callers with the same [name](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/variant/Sources#getByName(kotlin.String)) will get the same instance returned. Any callers can obtain the final list of the folders registered under this custom source type by calling Flat.all.

These sources directories are attached to the variant and will be visible to Android Studio.  

### getJava

```
abstract SourceDirectories.Flat getJava()
```

Access to the Java source folders.  

### getJniLibs

```
abstract SourceDirectories.Layered getJniLibs()
```

Access to the JNI libraries folders  

### getKotlin

```
@Incubating
abstract SourceDirectories.Flat getKotlin()
```

Access to the Kotlin source folders.  

### getManifests

```
abstract @NonNull ManifestFiles getManifests()
```

Access to all android manifest files. Main manifest file is always the first one.  

### getMlModels

```
abstract SourceDirectories.Layered getMlModels()
```

Access to the machine learning models folders if [com.android.build.api.dsl.ApplicationBuildFeatures.mlModelBinding](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/ApplicationBuildFeatures#mlModelBinding()) is true otherwise null  

### getRenderscript

```
abstract SourceDirectories.Flat getRenderscript()
```

Access to the renderscript sources folders if [com.android.build.api.dsl.BuildFeatures.renderScript](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#renderScript()) is true otherwise null. RenderScript APIs are deprecated starting in Android 12 [See more](https://developer.android.com/guide/topics/renderscript/migrate).  

### getRes

```
abstract SourceDirectories.Layered getRes()
```

Access to the Android resources sources folders if the component supports android resources or if [com.android.build.api.dsl.LibraryBuildFeatures.androidResources](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/LibraryBuildFeatures#androidResources()) is true for library variants, otherwise null.  

### getResources

```
abstract SourceDirectories.Flat getResources()
```

Access to the Java-style resources sources folders.  

### getShaders

```
abstract SourceDirectories.Layered getShaders()
```

Access to the shaders sources folders if [com.android.build.api.dsl.BuildFeatures.shaders](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/BuildFeatures#shaders()) is true otherwise null