[CLI] Prohibit passing HMPP module structure with CLI arguments to metadata compiler

^KT-57644 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-03-29 10:44:28 +03:00
committed by Space Team
parent b9c61bbc60
commit 96e9d690a6
4 changed files with 12 additions and 7 deletions
@@ -66,8 +66,12 @@ class K2MetadataCompiler : CLICompiler<K2MetadataCompilerArguments>() {
val commonSources = arguments.commonSources?.toSet() ?: emptySet()
val hmppCliModuleStructure = configuration.get(CommonConfigurationKeys.HMPP_MODULE_STRUCTURE)
if (hmppCliModuleStructure != null) {
collector.report(ERROR, "HMPP module structure should not be passed during metadata compilation. Please remove `-Xfragments` and related flags")
return ExitCode.COMPILATION_ERROR
}
for (arg in arguments.freeArgs) {
configuration.addKotlinSourceRoot(arg, isCommon = arg in commonSources, hmppCliModuleStructure?.getModuleNameForSource(arg))
configuration.addKotlinSourceRoot(arg, isCommon = arg in commonSources, hmppModuleName = null)
}
if (arguments.classpath != null) {
configuration.addJvmClasspathRoots(arguments.classpath!!.split(File.pathSeparatorChar).map(::File))