Interface KaptExtensionConfig
-
- All Implemented Interfaces:
public interface KaptExtensionConfigA plugin DSL extension for configuring kapt annotation processing.
Use the extension in your build script in the
kaptblock:kapt { // Your extension configuration }See also Kapt compiler plugin documentation.
-
-
Method Summary
Modifier and Type Method Description abstract UnitannotationProcessor(String fqName)Adds annotation processor with the specified fqName to the list of processors to run. abstract UnitannotationProcessors(String fqName)Adds annotation processors with the specified fqName to the list of processors to run. abstract Unitarguments(Function1<KaptArguments, Unit> action)Configure KaptArguments used for annotation processing. Unitarguments(Action<KaptArguments> action)Configures the KaptArguments used for annotation processing. abstract UnitjavacOptions(Function1<KaptJavacOption, Unit> action)Configures the KaptJavacOption used for annotation processing. UnitjavacOptions(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 BooleangetIncludeCompileClasspath()Also loads annotation processors from compile classpath. abstract UnitsetIncludeCompileClasspath(Boolean includeCompileClasspath)Also loads annotation processors from compile classpath. abstract BooleangetUseLightAnalysis()Skips analyzing code bodies, if possible. abstract UnitsetUseLightAnalysis(Boolean useLightAnalysis)Skips analyzing code bodies, if possible. abstract BooleangetCorrectErrorTypes()Replaces any generated error types with error types from the generated sources. abstract UnitsetCorrectErrorTypes(Boolean correctErrorTypes)Replaces any generated error types with error types from the generated sources. abstract BooleangetDumpDefaultParameterValues()Adds initializers to fields whose corresponding primary constructor parameters have a default value specified. abstract UnitsetDumpDefaultParameterValues(Boolean dumpDefaultParameterValues)Adds initializers to fields whose corresponding primary constructor parameters have a default value specified. abstract BooleangetMapDiagnosticLocations()Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources. abstract UnitsetMapDiagnosticLocations(Boolean mapDiagnosticLocations)Maps diagnostics reported on kapt stubs to their original locations in Kotlin sources. abstract BooleangetStrictMode()Reports any incompatibility errors found during stub generation. abstract UnitsetStrictMode(Boolean strictMode)Reports any incompatibility errors found during stub generation. abstract BooleangetStripMetadata()Strips @Metadataannotations from stubs.abstract UnitsetStripMetadata(Boolean stripMetadata)Strips @Metadataannotations from stubs.abstract BooleangetShowProcessorStats()Shows annotation processor statistics in the verbose kapt log output. abstract UnitsetShowProcessorStats(Boolean showProcessorStats)Shows annotation processor statistics in the verbose kapt log output. abstract StringgetDetectMemoryLeaks()Detects memory leaks in annotation processors. abstract UnitsetDetectMemoryLeaks(String detectMemoryLeaks)Detects memory leaks in annotation processors. abstract BooleangetUseBuildCache()Uses the Gradle build cache feature for kapt tasks. abstract UnitsetUseBuildCache(Boolean useBuildCache)Uses the Gradle build cache feature for kapt tasks. abstract BooleangetKeepJavacAnnotationProcessors()Keeps annotation processors that are added via the annotationProcessor(..)configuration for javac java-files compilationDefault:falseabstract UnitsetKeepJavacAnnotationProcessors(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
@Metadataannotations from stubs.Default:
false
-
setStripMetadata
abstract Unit setStripMetadata(Boolean stripMetadata)
Strips
@Metadataannotations 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
falseonly 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
falseonly 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
-
-
-
-