CLI K2: report an error for JS/Native/Metadata #KT-52035 Fixed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user