# AndroidSourceFile

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


```
interface AndroidSourceFile : Named
```

<br />

*** ** * ** ***

An AndroidSourceFile represents a single file input for an Android project.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/AndroidSourceFile#getName()()` A concise name for the source directory (typically used to identify it in a collection). |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/AndroidSourceFile#srcFile(kotlin.Any)(srcPath: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)` Sets the location of the file. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/AndroidSourceFile#name()` |

## Public functions

### getName

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

A concise name for the source directory (typically used to identify it in a collection).

### srcFile

Added in 4.2.0

```
fun srcFile(srcPath: Any): Any
```

Sets the location of the file.

| Parameters |
|---|---|
| `srcPath: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html` | The source directory. This is evaluated as `https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#file-java.lang.Object-` This method has a return value for legacy reasons. |

## Public properties

### name

```
val name: String
```