Kapt: Disable location mapping by default, allow to enable it manually

This commit is contained in:
Yan Zhulanow
2018-01-15 23:29:22 +09:00
parent 5668a7af92
commit 7c7c929b0e
15 changed files with 113 additions and 14 deletions
@@ -28,6 +28,10 @@ class ExampleAnnotationProcessor : AbstractProcessor() {
processAnnotation(roundEnv, annotation, prefix)
}
for (errorElement in roundEnv.getElementsAnnotatedWith(GenError::class.java)) {
processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, "GenError element", errorElement)
}
return true
}
@@ -67,7 +71,9 @@ class ExampleAnnotationProcessor : AbstractProcessor() {
override fun getSupportedSourceVersion() = SourceVersion.RELEASE_6
override fun getSupportedAnnotationTypes() = ANNOTATION_TO_PREFIX.keys.map { it.java.canonicalName }.toSet()
override fun getSupportedAnnotationTypes(): Set<String> {
return ANNOTATION_TO_PREFIX.keys.map { it.java.canonicalName }.toSet() + GenError::class.java.canonicalName
}
override fun getSupportedOptions() = setOf(SUFFIX_OPTION, GENERATE_KOTLIN_CODE_OPTION, GENERATE_ERROR)
}
@@ -15,4 +15,6 @@ annotation class ExampleBinaryAnnotation
@Inherited
@Retention(AnnotationRetention.RUNTIME)
annotation class ExampleRuntimeAnnotation
annotation class ExampleRuntimeAnnotation
annotation class GenError