Interface KaptExtensionConfig
-
- All Implemented Interfaces:
public interface 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.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
annotationProcessor(String fqName)
Adds annotation processor with the specified fqName to the list of processors to run. abstract Unit
annotationProcessors(String fqName)
Adds annotation processors with the specified fqName to the list of processors to run. abstract Unit
arguments(Function1<KaptArguments, Unit> action)
Configure KaptArguments used for annotation processing. Unit
arguments(Action<KaptArguments> action)
Configures the KaptArguments used for annotation processing. abstract Unit
javacOptions(Function1<KaptJavacOption, Unit> action)
Configures the KaptJavacOption used for annotation processing. Unit
javacOptions(Action<KaptJavacOption> action)
Configures the KaptJavacOption used for annotation processing. abstract Map<String, String>
getJavacOptions()
Gets all the javac options used to run kapt annotation processing. abstract Boolean
getIncludeCompileClasspath()
Also loads annotation processors from compile classpath. abstract Unit
setIncludeCompileClasspath(Boolean includeCompileClasspath)
Also loads annotation processors from compile classpath. abstract Boolean
getUseLightAnalysis()
Skips analyzing code bodies, if possible. abstract Unit
setUseLightAnalysis(Boolean useLightAnalysis)
Skips analyzing code bodies, if possible. abstract Boolean
getCorrectErrorTypes()
Replaces any generated error types with error types from the generated sources. abstract Unit
setCorrectErrorTypes(Boolean correctErrorTypes)
Replaces any generated error types with error types from the generated sources. abstract Boolean
getDumpDefaultParameterValues()
Adds initializers to fields whose corresponding primary constructor parameters have a default value specified. abstract Unit
setDumpDefaultParameterValues(Boolean dumpDefaultParameterValues)
Adds initializers to fields whose corresponding primary constructor parameters have a default value specified. abstract Boolean
getMapDiagnosticLocations()
Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources. abstract Unit
setMapDiagnosticLocations(Boolean mapDiagnosticLocations)
Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources. abstract Boolean
getStrictMode()
Reports any incompatibility errors found during stub generation. abstract Unit
setStrictMode(Boolean strictMode)
Reports any incompatibility errors found during stub generation. abstract Boolean
getStripMetadata()
Strips @Metadata
annotations from stubs.abstract Unit
setStripMetadata(Boolean stripMetadata)
Strips @Metadata
annotations from stubs.abstract Boolean
getShowProcessorStats()
Shows annotation processor statistics in the verbose kapt log output. abstract Unit
setShowProcessorStats(Boolean showProcessorStats)
Shows annotation processor statistics in the verbose kapt log output. abstract String
getDetectMemoryLeaks()
Detects memory leaks in annotation processors. abstract Unit
setDetectMemoryLeaks(String detectMemoryLeaks)
Detects memory leaks in annotation processors. abstract Boolean
getUseBuildCache()
Uses the Gradle build cache feature for kapt tasks. abstract Unit
setUseBuildCache(Boolean useBuildCache)
Uses the Gradle build cache feature for kapt tasks. abstract Boolean
getKeepJavacAnnotationProcessors()
Keeps annotation processors that are added via the annotationProcessor(..)
configuration for javac java-files compilationDefault:false
abstract Unit
setKeepJavacAnnotationProcessors(Boolean keepJavacAnnotationProcessors)
Keeps annotation processors that are added via the annotationProcessor(..)
configuration for javac java-files compilationDefault:false
-
-
Method Detail
-
annotationProcessor
abstract Unit annotationProcessor(String fqName)
Adds annotation processor with the specified fqName to the list of processors to run.
-
annotationProcessors
abstract Unit annotationProcessors(String fqName)
Adds annotation processors with the specified fqName to the list of processors to run.
-
arguments
abstract Unit arguments(Function1<KaptArguments, Unit> action)
Configure KaptArguments used for annotation processing.
-
arguments
Unit arguments(Action<KaptArguments> action)
Configures the KaptArguments used for annotation processing.
-
javacOptions
abstract Unit javacOptions(Function1<KaptJavacOption, Unit> action)
Configures the KaptJavacOption used for annotation processing.
-
javacOptions
Unit javacOptions(Action<KaptJavacOption> action)
Configures the KaptJavacOption used for annotation processing.
-
getJavacOptions
abstract Map<String, String> getJavacOptions()
Gets all the javac options used to run kapt annotation processing.
-
getIncludeCompileClasspath
abstract Boolean getIncludeCompileClasspath()
Also loads annotation processors from compile classpath.
Default:
null
-
setIncludeCompileClasspath
abstract Unit setIncludeCompileClasspath(Boolean includeCompileClasspath)
Also loads annotation processors from compile classpath.
Default:
null
-
getUseLightAnalysis
abstract Boolean getUseLightAnalysis()
Skips analyzing code bodies, if possible.
Default:
true
-
setUseLightAnalysis
abstract Unit setUseLightAnalysis(Boolean useLightAnalysis)
Skips analyzing code bodies, if possible.
Default:
true
-
getCorrectErrorTypes
abstract Boolean getCorrectErrorTypes()
Replaces any generated error types with error types from the generated sources.
Default:
false
-
setCorrectErrorTypes
abstract Unit setCorrectErrorTypes(Boolean correctErrorTypes)
Replaces any generated error types with error types from the generated sources.
Default:
false
-
getDumpDefaultParameterValues
abstract Boolean getDumpDefaultParameterValues()
Adds initializers to fields whose corresponding primary constructor parameters have a default value specified.
Default:
false
-
setDumpDefaultParameterValues
abstract Unit setDumpDefaultParameterValues(Boolean dumpDefaultParameterValues)
Adds initializers to fields whose corresponding primary constructor parameters have a default value specified.
Default:
false
-
getMapDiagnosticLocations
abstract Boolean getMapDiagnosticLocations()
Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources.
Default:
false
-
setMapDiagnosticLocations
abstract Unit setMapDiagnosticLocations(Boolean mapDiagnosticLocations)
Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources.
Default:
false
-
getStrictMode
abstract Boolean getStrictMode()
Reports any incompatibility errors found during stub generation.
Default:
false
-
setStrictMode
abstract Unit setStrictMode(Boolean strictMode)
Reports any incompatibility errors found during stub generation.
Default:
false
-
getStripMetadata
abstract Boolean getStripMetadata()
Strips
@Metadata
annotations from stubs.Default:
false
-
setStripMetadata
abstract Unit setStripMetadata(Boolean stripMetadata)
Strips
@Metadata
annotations from stubs.Default:
false
-
getShowProcessorStats
abstract Boolean getShowProcessorStats()
Shows annotation processor statistics in the verbose kapt log output.
Default:
false
-
setShowProcessorStats
abstract Unit setShowProcessorStats(Boolean showProcessorStats)
Shows annotation processor statistics in the verbose kapt log output.
Default:
false
-
getDetectMemoryLeaks
abstract String getDetectMemoryLeaks()
Detects memory leaks in annotation processors.
Possible values: "default", "paranoid", "none".
Default:
default
-
setDetectMemoryLeaks
abstract Unit setDetectMemoryLeaks(String detectMemoryLeaks)
Detects memory leaks in annotation processors.
Possible values: "default", "paranoid", "none".
Default:
default
-
getUseBuildCache
abstract Boolean getUseBuildCache()
Uses the Gradle build cache feature for kapt tasks.
Set to
false
only when annotation processors used by this project are:suspected of using other sources asides from the task inputs in their processing logic
not guaranteed to produce the same output on subsequent runs without input changes.
Default:
true
-
setUseBuildCache
abstract Unit setUseBuildCache(Boolean useBuildCache)
Uses the Gradle build cache feature for kapt tasks.
Set to
false
only when annotation processors used by this project are:suspected of using other sources asides from the task inputs in their processing logic
not guaranteed to produce the same output on subsequent runs without input changes.
Default:
true
-
getKeepJavacAnnotationProcessors
abstract Boolean getKeepJavacAnnotationProcessors()
Keeps annotation processors that are added via the
annotationProcessor(..)
configuration for javac java-files compilationDefault:
false
-
setKeepJavacAnnotationProcessors
abstract Unit setKeepJavacAnnotationProcessors(Boolean keepJavacAnnotationProcessors)
Keeps annotation processors that are added via the
annotationProcessor(..)
configuration for javac java-files compilationDefault:
false
-
-
-
-