[Gradle, JS] Provide disambiguation classifier for both mode
This commit is contained in:
+5
-2
@@ -69,10 +69,13 @@ class KotlinJsSingleTargetPreset(
|
||||
project,
|
||||
kotlinPluginVersion
|
||||
) {
|
||||
|
||||
// In a Kotlin/JS single-platform project, we don't need any disambiguation suffixes or prefixes in the names:
|
||||
override fun provideTargetDisambiguationClassifier(target: KotlinOnlyTarget<KotlinJsCompilation>): String? =
|
||||
null
|
||||
irPreset?.let {
|
||||
super.provideTargetDisambiguationClassifier(target)
|
||||
?.removePrefix(target.name.removeCapitalizedJsCompilerSuffix(JsCompilerType.legacy))
|
||||
?.decapitalize()
|
||||
}
|
||||
|
||||
override fun createKotlinTargetConfigurator() = KotlinJsTargetConfigurator(
|
||||
kotlinPluginVersion
|
||||
|
||||
+14
-4
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCompilationFactory
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinOnlyTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinOnlyTargetPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.removeCapitalizedJsCompilerSuffix
|
||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||
|
||||
open class KotlinJsIrTargetPreset(
|
||||
@@ -52,11 +53,20 @@ open class KotlinJsIrTargetPreset(
|
||||
class KotlinJsIrSingleTargetPreset(
|
||||
project: Project,
|
||||
kotlinPluginVersion: String
|
||||
) :
|
||||
KotlinJsIrTargetPreset(project, kotlinPluginVersion) {
|
||||
|
||||
) : KotlinJsIrTargetPreset(
|
||||
project,
|
||||
kotlinPluginVersion
|
||||
) {
|
||||
// In a Kotlin/JS single-platform project, we don't need any disambiguation suffixes or prefixes in the names:
|
||||
override fun provideTargetDisambiguationClassifier(target: KotlinOnlyTarget<KotlinJsIrCompilation>): String? = null
|
||||
override fun provideTargetDisambiguationClassifier(target: KotlinOnlyTarget<KotlinJsIrCompilation>): String? {
|
||||
return if (mixedMode!!) {
|
||||
super.provideTargetDisambiguationClassifier(target)
|
||||
?.removePrefix(target.name.removeCapitalizedJsCompilerSuffix(JsCompilerType.ir))
|
||||
?.decapitalize()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun createKotlinTargetConfigurator(): KotlinOnlyTargetConfigurator<KotlinJsIrCompilation, KotlinJsIrTarget> =
|
||||
KotlinJsIrTargetConfigurator(kotlinPluginVersion)
|
||||
|
||||
Reference in New Issue
Block a user