dependencies {
kapt "org.jetbrains.kotlin:kotlin-annotation-processing:$kotlin_version"
}
@Retention(AnnotationRetention.SOURCE)
annotation class MyAnnotation(val value: String)
@AutoService(Processor::class)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedAnnotationTypes("com.example.MyAnnotation")
class MyAnnotationProcessor : AbstractProcessor() {
override fun process(annotations: MutableSet<out TypeElement>?, roundEnv: RoundEnvironment?): Boolean {
return true
}
}
kapt {
arguments {
arg("kapt.kotlin.generated", "${project.buildDir}/kapt3")
}
}