mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[evaluation-plugin] ML-2969 Evaluation plugin failed to exit Application
GitOrigin-RevId: ddca825741b6ec088c5e8329f0fbdfcd7d8b8b5d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
23f84d1774
commit
25b5853c07
+10
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.cce.evaluation.step
|
||||
|
||||
import com.intellij.cce.actions.ProjectOpeningUtils
|
||||
@@ -6,13 +6,14 @@ import com.intellij.cce.evaluation.FinishEvaluationStep
|
||||
import com.intellij.cce.workspace.EvaluationWorkspace
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class HeadlessFinishEvaluationStep(private val project: Project) : FinishEvaluationStep {
|
||||
override fun start(workspace: EvaluationWorkspace, withErrors: Boolean) {
|
||||
if (withErrors) {
|
||||
println("Evaluation completed with errors.")
|
||||
ProjectOpeningUtils.closeProject(project)
|
||||
ApplicationManager.getApplication().exit(true, false, false, 1)
|
||||
exit(exitCode = 1)
|
||||
} else {
|
||||
print("Evaluation completed. ")
|
||||
if (workspace.getReports().isEmpty()) {
|
||||
@@ -23,7 +24,13 @@ class HeadlessFinishEvaluationStep(private val project: Project) : FinishEvaluat
|
||||
workspace.getReports().forEach { println("${it.key}: ${it.value}") }
|
||||
}
|
||||
ProjectOpeningUtils.closeProject(project)
|
||||
ApplicationManager.getApplication().exit(true, false, false)
|
||||
exit(exitCode = 0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun exit(exitCode: Int) = try {
|
||||
ApplicationManager.getApplication().exit(true, false, false, exitCode)
|
||||
} catch (t: Throwable) {
|
||||
exitProcess(exitCode)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user