[K/JS] Throw error when a module contains file with the same name and package (ignoring case)

This commit is contained in:
Artem Kobzar
2023-07-07 13:50:04 +00:00
committed by Space Team
parent 0e6930e7ef
commit 7c7aa98875
9 changed files with 94 additions and 4 deletions
@@ -24,6 +24,7 @@ internal const val MINIMIZED_MEMBER_NAMES = "-Xir-minimized-member-names"
internal const val KLIB_MODULE_NAME = "-Xir-module-name"
internal const val PER_FILE = "-Xir-per-file"
internal const val PER_MODULE = "-Xir-per-module"
internal const val PER_MODULE_OUTPUT_NAME = "-Xir-per-module-output-name"
@@ -7,7 +7,8 @@ package org.jetbrains.kotlin.gradle.targets.js.ir
enum class KotlinJsIrOutputGranularity {
WHOLE_PROGRAM,
PER_MODULE;
PER_MODULE,
PER_FILE;
companion object {
fun byArgument(argument: String): KotlinJsIrOutputGranularity? =
@@ -17,6 +18,9 @@ enum class KotlinJsIrOutputGranularity {
}
fun KotlinJsIrOutputGranularity.toCompilerArgument(): String {
val perModule = this == KotlinJsIrOutputGranularity.PER_MODULE
return "$PER_MODULE=$perModule"
return when (this) {
KotlinJsIrOutputGranularity.PER_FILE -> PER_FILE
KotlinJsIrOutputGranularity.PER_MODULE -> PER_MODULE
KotlinJsIrOutputGranularity.WHOLE_PROGRAM -> ""
}
}