CLI K2: report an error for JS/Native/Metadata #KT-52035 Fixed

This commit is contained in:
Mikhail Glukhikh
2022-04-25 15:47:11 +03:00
committed by Space
parent 17b5e46547
commit 08ba89b4ec
11 changed files with 44 additions and 0 deletions
@@ -172,6 +172,10 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@Nullable KotlinPaths paths
) {
MessageCollector messageCollector = configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY);
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR)) {
messageCollector.report(ERROR, "K2 does not support JS target right now", null);
return ExitCode.COMPILATION_ERROR;
}
ExitCode exitCode = OK;
@@ -87,6 +87,10 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
paths: KotlinPaths?
): ExitCode {
val messageCollector = configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR)) {
messageCollector.report(ERROR, "K2 does not support JS target right now")
return ExitCode.COMPILATION_ERROR
}
val pluginLoadResult = loadPlugins(paths, arguments, configuration)
if (pluginLoadResult != ExitCode.OK) return pluginLoadResult