[Gradle, JS] Fix name of publication in both mode
This commit is contained in:
+4
-3
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.AbstractKotlinTargetConfigurator.Companion.runTaskNameSuffix
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.MAIN_COMPILATION_NAME
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType.LEGACY
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBrowserDsl
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsNodeDsl
|
||||
@@ -55,7 +56,7 @@ constructor(
|
||||
|
||||
val disambiguationClassifierInPlatform: String?
|
||||
get() = if (irTarget != null) {
|
||||
disambiguationClassifier?.removeJsCompilerSuffix(KotlinJsCompilerType.LEGACY)
|
||||
disambiguationClassifier?.removeJsCompilerSuffix(LEGACY)
|
||||
} else {
|
||||
disambiguationClassifier
|
||||
}
|
||||
@@ -70,7 +71,7 @@ constructor(
|
||||
|
||||
val componentName =
|
||||
if (project.kotlinExtension is KotlinMultiplatformExtension)
|
||||
targetName
|
||||
irTarget?.let { targetName.removeJsCompilerSuffix(LEGACY) } ?: targetName
|
||||
else PRIMARY_SINGLE_COMPONENT_NAME
|
||||
|
||||
val result = createKotlinVariant(componentName, mainCompilation, usageContexts)
|
||||
@@ -104,7 +105,7 @@ constructor(
|
||||
): KotlinVariant {
|
||||
return super.createKotlinVariant(componentName, compilation, usageContexts).apply {
|
||||
irTarget?.let {
|
||||
artifactTargetName = targetName.removeJsCompilerSuffix(KotlinJsCompilerType.LEGACY)
|
||||
artifactTargetName = targetName.removeJsCompilerSuffix(LEGACY)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user