Don't use exitProcess to indicate a failure in Native library resolver

If Native compiler performs exitProcess, it crashes Gradle daemon that
runs the compiler.
This commit is contained in:
Svyatoslav Scherbina
2021-04-06 12:41:46 +03:00
committed by Space
parent f1cdd0e2ed
commit df77cd303f
2 changed files with 2 additions and 5 deletions
@@ -61,7 +61,6 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
val project = environment.project
val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) ?: MessageCollector.NONE
configuration.put(CLIConfigurationKeys.PHASE_CONFIG, createPhaseConfig(toplevelPhase, arguments, messageCollector))
val konanConfig = KonanConfig(project, configuration)
val enoughArguments = arguments.freeArgs.isNotEmpty() || arguments.isUsefulWithoutFreeArgs
if (!enoughArguments) {
@@ -75,6 +74,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
}
try {
val konanConfig = KonanConfig(project, configuration)
runTopLevelPhases(konanConfig, environment)
} catch (e: KonanCompilationException) {
return ExitCode.COMPILATION_ERROR