[Gradle, JS] Remove redundant fixing names

- in case when target name is `jsLegacy` with enabled both mode, we should get `jsLegacyMain` and `jsLegacyTest`, and Gradle plugin creates targets `jsLegacyLegacy` and `jsLegacyIr`, schema is name+suffix where name can be any, KotlinJsTargetPreset's name is name+`Both` so in KotlinJsTargetPreset in `both` case we need remove only `Both` suffix

#KT-39213 Fixed
This commit is contained in:
Ilya Goncharov
2020-06-02 11:46:08 +03:00
parent 44f16eac2e
commit b68715441f
@@ -31,13 +31,11 @@ open class KotlinJsTargetPreset(
override val platformType: KotlinPlatformType
get() = KotlinPlatformType.js
override fun useDisambiguitionClassifierAsSourcesetNamePreffix() = false
override fun useDisambiguitionClassifierAsSourcesetNamePreffix() = irPreset == null
override fun overrideDisambiguitionClassifierOnIdeImport(): String? = if (isMpp) {
irPreset?.let {
name.removeJsCompilerSuffix(KotlinJsCompilerType.LEGACY)
.removeJsCompilerSuffix(KotlinJsCompilerType.IR)
.removeJsCompilerSuffix(KotlinJsCompilerType.BOTH)
name.removeJsCompilerSuffix(KotlinJsCompilerType.BOTH)
}
} else {
null