# AnnotationProcessorOptions

# AnnotationProcessorOptions

```
@Incubating interface AnnotationProcessorOptions
```

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [com.android.build.api.dsl.AnnotationProcessorOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#) |

Options for configuring Java annotation processor.

## Summary

|                                                                                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [argument](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#argument(kotlin.String,%20kotlin.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.                                                                                                                                                                                   |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [arguments](https://developer.android.com/reference/tools/gradle-api/7.0/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.                                                                                                      |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [className](https://developer.android.com/reference/tools/gradle-api/7.0/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.                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [classNames](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#classNames(kotlin.String))`(`vararg` `classNames:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds annotation processor classes to run.                                                                                                                                                                                                                                                                                                              |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compilerArgumentProvider](https://developer.android.com/reference/tools/gradle-api/7.0/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.           |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider))`(`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. |

|                                                                                                                                                                                                                                                                                                                                                         ### Properties                                                                                                                                                                                                                                                                                                                                                          ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#arguments:kotlin.collections.MutableMap) Specifies arguments that represent primitive types for annotation processors.                                                                                                                                                                                        |
| abstract[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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#classNames:kotlin.collections.MutableList) Specifies the annotation processor classes to run.                                                                                                                                                                                                                |
| abstract[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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders:kotlin.collections.MutableList) 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 methods

### argument

```
abstract 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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider)).  
**See Also**

- `
  `[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider))
  `
`  

### arguments

```
abstract 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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider)).  
**See Also**

- `
  `[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider))
  `
`  

### className

```
abstract 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

```
abstract 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

```
abstract 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

```
abstract 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).

## Properties

### arguments

```
abstract 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/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider)).  
**See Also**

- `
  `[compilerArgumentProviders](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/AnnotationProcessorOptions#compilerArgumentProviders(org.gradle.process.CommandLineArgumentProvider))
  `
`  

### classNames

```
abstract 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

```
abstract 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).