My gradle build:
buildscript {
ext.kotlin_version = '1.1.4-3'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: "kotlin-kapt"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
kapt {
processors = "libs.orm.codeGenerators.ModelProcessor" //PROCESSOR
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "com.google.auto.service:auto-service:1.0-rc3"
}
The processor is not in separate module.
Processor does nothing, in #process
it simply throws, to see if it's working.
@AutoService(Processor::class)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
class ModelProcessor : AbstractProcessor() {
override fun process(annotations: MutableSet<out TypeElement>?, roundEnv: RoundEnvironment): Boolean {
throw(Throwable("foo"))
return true
}
override fun getSupportedAnnotationTypes() : MutableSet<String> {
return mutableSetOf<String>("*")
}
}
But absolutely nothing happens. No error, nothing. How can I make it work?
kapt
configuration, it's where kapt searches for the processors. You can do it by separating the modules and thendependencies { kapt project(':processor') }
. – hotkeySources output directory is not specified for processor_main, skipping annotation processing
– Sheppard@AutoService
– user3605025Sources output directory is not specified for processor_main, skipping annotation processing
still is logged, but code is being generated ignoring it. – Sheppard