# AndroidSourceSet

# AndroidSourceSet

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

<br />

```
interface AndroidSourceSet : Named
```

<br />

*** ** * ** ***

An AndroidSourceSet represents a logical group of Java, aidl and RenderScript sources as well as Android and non-Android (Java-style) resources.

## Summary

|                               ### Public functions                               |
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [aidl](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#aidl(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android AIDL source directory for this source set.                                                                                                                              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [assets](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#assets(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android Assets directory for this source set.                                                                                                                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [baselineProfiles](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#baselineProfiles(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android Baseline Profiles source directory for this source set. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#getName())`()` Returns the name of this source set.                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [java](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#java(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Java source for this source-set                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) ~~[jni](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jni(kotlin.Function1))~~`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` **This function is deprecated.**Unused                                                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [jniLibs](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jniLibs(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android JNI libs directory for this source-set                                                                                                                            |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [kotlin](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#kotlin(org.gradle.api.Action))`(action: `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)`<`[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`>)` The Kotlin source for this source-set                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [manifest](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#manifest(kotlin.Function1))`(action: `[AndroidSourceFile](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceFile)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android Manifest file for this source-set.                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [mlModels](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#mlModels(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The machine learning models directory for this source set.                                                                                                                  |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [renderscript](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#renderscript(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android RenderScript source directory for this source set.                                                                                                      |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [res](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#res(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android Resources directory for this source-set.                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [resources](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#resources(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Java-style resources for this source-set                                                                                                                              |
| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)       | [setRoot](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#setRoot(kotlin.String))`(path: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets the root of the source sets to a given path.                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [shaders](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#shaders(kotlin.Function1))`(action: `[AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` The Android shaders directory for this source set.                                                                                                                            |

|                                                             ### Public properties                                                              |
|------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [aidl](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#aidl()) The Android AIDL source directory for this source set.                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [annotationProcessorConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#annotationProcessorConfigurationName()) Returns the name of the annotation processing tool classpath for this source set. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [apiConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#apiConfigurationName()) Returns the name of the api configuration for this source set.                                                    |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [assets](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#assets()) The Android Assets directory for this source set.                                                                                             |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [baselineProfiles](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#baselineProfiles()) The Android Baseline Profiles source directory for this source set.                                                       |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [compileOnlyApiConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#compileOnlyApiConfigurationName()) Returns the name of the compileOnlyApi configuration for this source set.                   |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [compileOnlyConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#compileOnlyConfigurationName()) Returns the name of the compileOnly configuration for this source set.                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [implementationConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#implementationConfigurationName()) Returns the name of the implementation configuration for this source set.                   |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [java](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#java()) The Java source for this source-set                                                                                                               |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [jni](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jni()) **This property is deprecated.**Unused                                                                                                              |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [jniLibs](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jniLibs()) The Android JNI libs directory for this source-set                                                                                          |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [kaptConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#kaptConfigurationName()) Returns the name of the kapt annotation processing tool classpath for this source set.                          |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [kotlin](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#kotlin()) The Kotlin source for this source-set                                                                                                         |
| [AndroidSourceFile](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceFile)                 | [manifest](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#manifest()) The Android Manifest file for this source-set.                                                                                            |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [mlModels](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#mlModels()) The machine learning models directory for this source set.                                                                                |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [renderscript](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#renderscript()) The Android RenderScript source directory for this source set.                                                                    |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [res](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#res()) The Android Resources directory for this source-set.                                                                                                |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [resources](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#resources()) The Java-style resources for this source-set                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [runtimeOnlyConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#runtimeOnlyConfigurationName()) Returns the name of the implementation configuration for this source set.                         |
| [AndroidSourceDirectorySet](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceDirectorySet) | [shaders](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#shaders()) The Android shaders directory for this source set.                                                                                          |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                               | [wearAppConfigurationName](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#wearAppConfigurationName()) **This property is deprecated.**Deprecated configuration - to be removed in AGP 9.0                       |

## Public functions

### aidl

Added in 4.2.0  

```
fun aidl(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android AIDL source directory for this source set.  

### assets

Added in 4.2.0  

```
fun assets(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android Assets directory for this source set.  

### baselineProfiles

Added in 8.0.2  

```
@Incubating
fun baselineProfiles(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android Baseline Profiles source directory for this source set.  

### getName

```
fun getName(): String
```

Returns the name of this source set.  

### java

Added in 4.2.0  

```
fun java(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Java source for this source-set  

### jni

Added in 4.2.0  
Deprecated in 7.0.0  

```
@Incubating
fun [jni](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/AndroidSourceSet#jni(kotlin.Function1))(action: AndroidSourceDirectorySet.() -> Unit): Unit
```
| **This function is deprecated.**   
| Unused

The Android JNI source directory for this source set.

This is unused and will be removed in AGP 9.0  

### jniLibs

Added in 4.2.0  

```
fun jniLibs(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android JNI libs directory for this source-set  

### kotlin

Added in 7.0.0  

```
fun kotlin(action: Action<AndroidSourceDirectorySet>): Unit
```

The Kotlin source for this source-set  

### manifest

Added in 4.2.0  

```
fun manifest(action: AndroidSourceFile.() -> Unit): Unit
```

The Android Manifest file for this source-set.  

### mlModels

Added in 4.2.0  

```
fun mlModels(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The machine learning models directory for this source set.  

### renderscript

Added in 4.2.0  

```
fun renderscript(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android RenderScript source directory for this source set.  

### res

Added in 4.2.0  

```
fun res(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android Resources directory for this source-set.  

### resources

Added in 4.2.0  

```
fun resources(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Java-style resources for this source-set  

### setRoot

Added in 4.2.0  

```
fun setRoot(path: String): Any
```

Sets the root of the source sets to a given path.

All entries of the source-set are located under this root directory.

This method has a return value for legacy reasons.  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|---------------------------------|
| `path: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the root directory path to use. |

### shaders

Added in 4.2.0  

```
fun shaders(action: AndroidSourceDirectorySet.() -> Unit): Unit
```

The Android shaders directory for this source set.  

## Public properties

### aidl

Added in 4.2.0  

```
val aidl: AndroidSourceDirectorySet
```

The Android AIDL source directory for this source set.  

### annotationProcessorConfigurationName

Added in 4.2.0  

```
val annotationProcessorConfigurationName: String
```

Returns the name of the annotation processing tool classpath for this source set.  

### apiConfigurationName

Added in 4.2.0  

```
val apiConfigurationName: String
```

Returns the name of the api configuration for this source set.  

### assets

Added in 4.2.0  

```
val assets: AndroidSourceDirectorySet
```

The Android Assets directory for this source set.  

### baselineProfiles

Added in 8.0.2  

```
val baselineProfiles: AndroidSourceDirectorySet
```

The Android Baseline Profiles source directory for this source set.  

### compileOnlyApiConfigurationName

Added in 8.4.0  

```
val compileOnlyApiConfigurationName: String
```

Returns the name of the compileOnlyApi configuration for this source set.  

### compileOnlyConfigurationName

Added in 4.2.0  

```
val compileOnlyConfigurationName: String
```

Returns the name of the compileOnly configuration for this source set.  

### implementationConfigurationName

Added in 4.2.0  

```
val implementationConfigurationName: String
```

Returns the name of the implementation configuration for this source set.  

### java

Added in 4.2.0  

```
val java: AndroidSourceDirectorySet
```

The Java source for this source-set  

### jni

Added in 4.2.0  
Deprecated in 7.0.0  

```
val jni: AndroidSourceDirectorySet
```
| **This property is deprecated.**   
| Unused

The Android JNI source directory for this source set.

This is unused and will be removed in AGP 9.0  

### jniLibs

Added in 4.2.0  

```
val jniLibs: AndroidSourceDirectorySet
```

The Android JNI libs directory for this source-set  

### kaptConfigurationName

Added in 8.7.0  

```
val kaptConfigurationName: String
```

Returns the name of the kapt annotation processing tool classpath for this source set.

This configuration is only created when built-in KAPT support is enabled.  

### kotlin

Added in 7.0.0  

```
val kotlin: AndroidSourceDirectorySet
```

The Kotlin source for this source-set  

### manifest

Added in 4.2.0  

```
val manifest: AndroidSourceFile
```

The Android Manifest file for this source-set.  

### mlModels

Added in 4.2.0  

```
val mlModels: AndroidSourceDirectorySet
```

The machine learning models directory for this source set.  

### renderscript

Added in 4.2.0  

```
val renderscript: AndroidSourceDirectorySet
```

The Android RenderScript source directory for this source set.  

### res

Added in 4.2.0  

```
val res: AndroidSourceDirectorySet
```

The Android Resources directory for this source-set.  

### resources

Added in 4.2.0  

```
val resources: AndroidSourceDirectorySet
```

The Java-style resources for this source-set  

### runtimeOnlyConfigurationName

Added in 4.2.0  

```
val runtimeOnlyConfigurationName: String
```

Returns the name of the implementation configuration for this source set.  

### shaders

Added in 4.2.0  

```
val shaders: AndroidSourceDirectorySet
```

The Android shaders directory for this source set.  

### wearAppConfigurationName

Added in 4.2.0  
Deprecated in 8.6.0  

```
val wearAppConfigurationName: String
```
| **This property is deprecated.**   
| Deprecated configuration - to be removed in AGP 9.0

Returns the name of the wearApp configuration for this source set.