Clean up fall-back logic in IncrementalCompilerRunner

Make it clear that there 3 distinct cases:
   1. Incremental compilation completed with an ExitCode.
   2. Incremental compilation was not possible for some valid reason
      (e.g., for a clean build), and we will perform non-incremental
      compilation.
   3. Incremental compilation failed with an exception.
      In this case, we will:
        - Print a warning with a stack trace
        - Ask the user to file a bug
        - Collect rebuild reason enum for analytics
           + TODO: Collect the stack trace too
        - Fall back to non-incremental compilation

Test: Existing BaseIncrementalCompilationMultiProjectIT.testFailureHandling_UserError,
      Updated BaseIncrementalCompilationMultiProjectIT.testFailureHandling_ToolError

^KT-53015: In progress
This commit is contained in:
Hung Nguyen
2022-06-20 13:41:40 +01:00
committed by Andrey Uskov
parent 57bbc335f4
commit def886cd31
24 changed files with 409 additions and 341 deletions
@@ -781,7 +781,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
} catch (e: Exception) {
TestCase.assertEquals(
"Unable to use scripting/REPL in the daemon: no scripting plugin loaded",
e.message
e.cause?.message
)
isErrorThrown = true
} finally {