Warn in Gradle log when incremental compilation fails

When incremental compilation fails, we currently log it at the `debug`
level (and fall back to non-incremental compilation). This commit will
change it to `warning` so that we can get more user reports, which will
allow us to fix the root cause.

Also make sure the warning includes a stack trace.

Additionally, let ReportSeverity.fromCode() return a non-null value
or throw an exception otherwise as that case is not expected.

^KT-52839 In Progress
This commit is contained in:
Hung Nguyen
2022-06-16 15:56:41 +01:00
committed by teamcity
parent 623f832bfd
commit e01c2bc651
23 changed files with 358 additions and 118 deletions
@@ -63,7 +63,6 @@ fun MessageCollector.reportFromDaemon(outputsCollector: ((File, List<File>) -> U
ReportSeverity.WARNING -> CompilerMessageSeverity.WARNING
ReportSeverity.INFO -> CompilerMessageSeverity.INFO
ReportSeverity.DEBUG -> CompilerMessageSeverity.LOGGING
else -> throw IllegalStateException("Unexpected compiler message report severity $severity")
}
if (message != null) {
report(compilerSeverity, message, attachment as? CompilerMessageSourceLocation)
@@ -92,7 +91,7 @@ private fun MessageCollector.reportUnexpected(category: Int, severity: Int, mess
ReportSeverity.ERROR -> CompilerMessageSeverity.ERROR
ReportSeverity.WARNING -> CompilerMessageSeverity.WARNING
ReportSeverity.INFO -> CompilerMessageSeverity.INFO
else -> CompilerMessageSeverity.LOGGING
ReportSeverity.DEBUG -> CompilerMessageSeverity.LOGGING
}
report(compilerMessageSeverity, "Unexpected message: category=$category; severity=$severity; message='$message'; attachment=$attachment")