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
@@ -62,6 +62,10 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
configuration, EnvironmentConfigFiles.NATIVE_CONFIG_FILES)
val project = environment.project
val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) ?: MessageCollector.NONE
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR)) {
messageCollector.report(ERROR, "K2 does not support Native target right now")
return ExitCode.COMPILATION_ERROR
}
configuration.put(CLIConfigurationKeys.PHASE_CONFIG, createPhaseConfig(toplevelPhase, arguments, messageCollector))
val enoughArguments = arguments.freeArgs.isNotEmpty() || arguments.isUsefulWithoutFreeArgs