- kapt: Default annotation processor for Kotlin projects, useful to reference generated code at compile time in a kotlin project. In order to use it you should use the
kotlin-kapt
plugin. It also takes care of java classes
plugins {
kotlin("kapt") version "1.7.10"
}
and the related dependency:
dependencies {
kapt("groupId:artifactId:version")
}
- annotationProcessor: gradle directive to specify your own annotationProcessor or a third party one. For example, in the old android projects was common to use Butterknife library that has its own annotation processor:
dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
}
In general, an annotation processor
is useful to generate code automatically from annotations (for butternife, for example @BindView
) and this is true both for kapt and for a random third-party annotation processor.