Kapt: Strict mode. Issue an error if the converter fails to process a class (#KT-25518, #KT-24272)

This commit is contained in:
Yan Zhulanow
2018-07-16 21:00:40 +03:00
parent ef210d7122
commit c83581e6b8
12 changed files with 152 additions and 26 deletions
@@ -224,10 +224,17 @@ class KaptJavaLog(
}
}
fun KaptContext.kaptError(text: String): JCDiagnostic {
private val LINE_SEPARATOR: String = System.getProperty("line.separator")
fun KaptContext.kaptError(vararg line: String): JCDiagnostic {
val text = line.joinToString(LINE_SEPARATOR)
return JCDiagnostic.Factory.instance(context).errorJava9Aware(null, null, "proc.messager", text)
}
fun KaptContext.reportKaptError(vararg line: String) {
compiler.log.report(kaptError(*line))
}
private fun JCDiagnostic.Factory.errorJava9Aware(
source: DiagnosticSource?,
pos: JCDiagnostic.DiagnosticPosition?,