# AnnotationProcessorOptions

# AnnotationProcessorOptions

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

<br />

```
interface AnnotationProcessorOptions
```

<br />

*** ** * ** ***

Options for configuring Java annotation processor.

## Summary

|                             ### Public functions                             |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [argument](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#argument(kotlin.String,kotlin.String))`(key: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds an argument that represent primitive types for annotation processors.                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [arguments](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#arguments(kotlin.collections.Map))`(arguments: `[Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>)` Adds arguments that represent primitive types for annotation processors.                                                                                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [className](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#className(kotlin.String))`(className: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds an annotation processor class to run.                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [classNames](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#classNames(kotlin.Array))`(vararg classNames: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds annotation processor classes to run.                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compilerArgumentProvider](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProvider(org.gradle.process.CommandLineArgumentProvider))`(` ` compilerArgumentProvider: `[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html) `)` Adds an argument for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array))`(` ` vararg compilerArgumentProviders: `[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html) `)` Adds arguments for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class.                           |

|                                                                                                                              ### Public properties                                                                                                                              |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` | [arguments](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#arguments()) Specifies arguments that represent primitive types for annotation processors.                                                                                                                                                                                       |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`                                                                                   | [classNames](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#classNames()) Specifies the annotation processor classes to run.                                                                                                                                                                                                                |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`<`[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)`>`                                         | [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders()) Specifies arguments for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class. |

## Public functions

### argument

Added in 4.2.0  

```
fun argument(key: String, value: String): Unit
```

Adds an argument that represent primitive types for annotation processors.

If one or more arguments represent files or directories, you must instead use[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)).  

|                                                                                        See also                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)) |   |

### arguments

Added in 4.2.0  

```
fun arguments(arguments: Map<String, String>): Unit
```

Adds arguments that represent primitive types for annotation processors.

If one or more arguments represent files or directories, you must instead use[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)).  

|                                                                                        See also                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)) |   |

### className

Added in 4.2.0  

```
fun className(className: String): Unit
```

Adds an annotation processor class to run.

By default, this property is empty and the plugin automatically discovers and runs annotation processors that you add to the annotation processor classpath. To learn more about adding annotation processor dependencies to your project, read[Add annotation processors](https://d.android.com/studio/build/dependencies#annotation_processor).  

### classNames

Added in 4.2.0  

```
fun classNames(vararg classNames: String): Unit
```

Adds annotation processor classes to run.

By default, this property is empty and the plugin automatically discovers and runs annotation processors that you add to the annotation processor classpath. To learn more about adding annotation processor dependencies to your project, read[Add annotation processors](https://d.android.com/studio/build/dependencies#annotation_processor).  

### compilerArgumentProvider

Added in 4.2.0  

```
fun compilerArgumentProvider(
    compilerArgumentProvider: CommandLineArgumentProvider
): Unit
```

Adds an argument for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class.

The benefit of using this class is that it allows you or the annotation processor author to improve the correctness and performance of incremental and cached clean builds by applying[incremental build property type annotations](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks).

To learn more about how to use this class to annotate arguments for annotation processors and pass them to the Android plugin, read[Pass arguments to annotation processors](https://developer.android.com/studio/build/dependencies#processor-arguments).  

### compilerArgumentProviders

Added in 4.2.0  

```
fun compilerArgumentProviders(
    vararg compilerArgumentProviders: CommandLineArgumentProvider
): Unit
```

Adds arguments for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class.

The benefit of using this class is that it allows you or the annotation processor author to improve the correctness and performance of incremental and cached clean builds by applying[incremental build property type annotations](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks).

To learn more about how to use this class to annotate arguments for annotation processors and pass them to the Android plugin, read[Pass arguments to annotation processors](https://developer.android.com/studio/build/dependencies#processor-arguments).  

## Public properties

### arguments

Added in 4.2.0  

```
val arguments: MutableMap<String, String>
```

Specifies arguments that represent primitive types for annotation processors.

If one or more arguments represent files or directories, you must instead use[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)).  

|                                                                                        See also                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(kotlin.Array)) |   |

### classNames

Added in 4.2.0  

```
val classNames: MutableList<String>
```

Specifies the annotation processor classes to run.

By default, this property is empty and the plugin automatically discovers and runs annotation processors that you add to the annotation processor classpath. To learn more about adding annotation processor dependencies to your project, read[Add annotation processors](https://d.android.com/studio/build/dependencies#annotation_processor).  

### compilerArgumentProviders

Added in 4.2.0  

```
val compilerArgumentProviders: MutableList<CommandLineArgumentProvider>
```

Specifies arguments for annotation processors that you want to pass to the Android plugin using the[CommandLineArgumentProvider](https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArgumentProvider.html)class.

The benefit of using this class is that it allows you or the annotation processor author to improve the correctness and performance of incremental and cached clean builds by applying[incremental build property type annotations](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks).

To learn more about how to use this class to annotate arguments for annotation processors and pass them to the Android plugin, read[Pass arguments to annotation processors](https://developer.android.com/studio/build/dependencies#processor-arguments).