JVM_IR: Prevent writing output after an error is reported
#KT-53825 Fixed
This commit is contained in:
committed by
Alexander Udalov
parent
252e97663b
commit
7b3ce35613
+1
-1
@@ -147,7 +147,7 @@ object FirKotlinToJvmBytecodeCompiler {
|
||||
findMainClass(outputs.single().first.fir)
|
||||
}
|
||||
|
||||
return writeOutputs(
|
||||
return writeOutputsIfNeeded(
|
||||
project,
|
||||
projectConfiguration,
|
||||
chunk,
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ object KotlinToJVMBytecodeCompiler {
|
||||
outputs += runCodegen(input, input.state, codegenFactory, result.bindingContext, diagnosticsReporter, environment.configuration)
|
||||
}
|
||||
|
||||
return writeOutputs(environment.project, projectConfiguration, chunk, outputs, mainClassFqName)
|
||||
return writeOutputsIfNeeded(environment.project, projectConfiguration, chunk, outputs, mainClassFqName)
|
||||
}
|
||||
|
||||
fun compileBunchOfSources(environment: KotlinCoreEnvironment): Boolean {
|
||||
|
||||
@@ -122,13 +122,17 @@ fun writeOutput(
|
||||
outputFiles.writeAll(outputDir, messageCollector, reportOutputFiles)
|
||||
}
|
||||
|
||||
fun writeOutputs(
|
||||
fun writeOutputsIfNeeded(
|
||||
project: Project?,
|
||||
projectConfiguration: CompilerConfiguration,
|
||||
chunk: List<Module>,
|
||||
outputs: List<GenerationState>,
|
||||
mainClassFqName: FqName?
|
||||
): Boolean {
|
||||
if (projectConfiguration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY).hasErrors()) {
|
||||
return false
|
||||
}
|
||||
|
||||
try {
|
||||
for (state in outputs) {
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||
|
||||
Reference in New Issue
Block a user