KaptExtensionConfig

A plugin DSL extension for configuring kapt annotation processing.

Use the extension in your build script in the kapt block:

kapt {
// Your extension configuration
}

See also Kapt compiler plugin documentation.

Properties

Link copied to clipboard
abstract var correctErrorTypes: Boolean

Replaces any generated error types with error types from the generated sources.

Link copied to clipboard
abstract var detectMemoryLeaks: String

Detects memory leaks in annotation processors.

Link copied to clipboard
abstract var dumpDefaultParameterValues: Boolean

Adds initializers to fields whose corresponding primary constructor parameters have a default value specified.

Link copied to clipboard
abstract var includeCompileClasspath: Boolean?

Also loads annotation processors from compile classpath.

Link copied to clipboard
abstract var keepJavacAnnotationProcessors: Boolean

Keeps annotation processors that are added via the annotationProcessor(..) configuration for javac java-files compilation

Link copied to clipboard
abstract var mapDiagnosticLocations: Boolean

Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources.

Link copied to clipboard
abstract var showProcessorStats: Boolean

Shows annotation processor statistics in the verbose kapt log output.

Link copied to clipboard
abstract var strictMode: Boolean

Reports any incompatibility errors found during stub generation.

Link copied to clipboard
abstract var stripMetadata: Boolean

Strips @Metadata annotations from stubs.

Link copied to clipboard
abstract var useBuildCache: Boolean

Uses the Gradle build cache feature for kapt tasks.

Link copied to clipboard
abstract var useLightAnalysis: Boolean

Skips analyzing code bodies, if possible.

Functions

Link copied to clipboard
abstract fun annotationProcessor(fqName: String)

Adds annotation processor with the specified fqName to the list of processors to run.

Link copied to clipboard
abstract fun annotationProcessors(vararg fqName: String)

Adds annotation processors with the specified fqName to the list of processors to run.

Link copied to clipboard
abstract fun arguments(action: KaptArguments.() -> Unit)

Configure KaptArguments used for annotation processing.

open fun arguments(action: Action<KaptArguments>)

Configures the KaptArguments used for annotation processing.

Link copied to clipboard
abstract fun getJavacOptions(): Map<String, String>

Gets all the javac options used to run kapt annotation processing.

Link copied to clipboard
abstract fun javacOptions(action: KaptJavacOption.() -> Unit)
open fun javacOptions(action: Action<KaptJavacOption>)

Configures the KaptJavacOption used for annotation processing.