[Gradle, JS] Fix naming
This commit is contained in:
+2
-2
@@ -450,11 +450,11 @@ fun Configuration.usesPlatformOf(target: KotlinTarget): Configuration {
|
|||||||
attributes.attribute(KotlinPlatformType.attribute, target.platformType)
|
attributes.attribute(KotlinPlatformType.attribute, target.platformType)
|
||||||
|
|
||||||
if (target is KotlinJsTarget) {
|
if (target is KotlinJsTarget) {
|
||||||
attributes.attribute(KotlinJsTarget.jsLegacyAttribute, LEGACY)
|
attributes.attribute(KotlinJsTarget.jsModeAttribute, LEGACY)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target is KotlinJsIrTarget) {
|
if (target is KotlinJsIrTarget) {
|
||||||
attributes.attribute(KotlinJsTarget.jsLegacyAttribute, IR)
|
attributes.attribute(KotlinJsTarget.jsModeAttribute, IR)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Provide an universal way to copy attributes from the target.
|
// TODO: Provide an universal way to copy attributes from the target.
|
||||||
|
|||||||
+2
-4
@@ -31,11 +31,9 @@ open class KotlinJsPlugin(
|
|||||||
val kotlinExtension = project.kotlinExtension as KotlinJsProjectExtension
|
val kotlinExtension = project.kotlinExtension as KotlinJsProjectExtension
|
||||||
configureDefaultVersionsResolutionStrategy(project, kotlinPluginVersion)
|
configureDefaultVersionsResolutionStrategy(project, kotlinPluginVersion)
|
||||||
|
|
||||||
KotlinJsTarget.setupAttributesMatchingStrategy(project.dependencies.attributesSchema)
|
val irPreset = if (mixedMode) KotlinJsIrSingleTargetPreset(project, kotlinPluginVersion) else null
|
||||||
|
|
||||||
val irPrest = if (mixedMode) KotlinJsIrSingleTargetPreset(project, kotlinPluginVersion) else null
|
val target = KotlinJsSingleTargetPreset(project, kotlinPluginVersion, irPreset).createTarget("Js")
|
||||||
|
|
||||||
val target = KotlinJsSingleTargetPreset(project, kotlinPluginVersion, irPrest).createTarget("Js")
|
|
||||||
|
|
||||||
kotlinExtension.target = target
|
kotlinExtension.target = target
|
||||||
|
|
||||||
|
|||||||
+2
-11
@@ -10,7 +10,6 @@ import org.gradle.api.Project
|
|||||||
import org.gradle.api.artifacts.ConfigurablePublishArtifact
|
import org.gradle.api.artifacts.ConfigurablePublishArtifact
|
||||||
import org.gradle.api.artifacts.Dependency
|
import org.gradle.api.artifacts.Dependency
|
||||||
import org.gradle.api.attributes.Attribute
|
import org.gradle.api.attributes.Attribute
|
||||||
import org.gradle.api.attributes.AttributesSchema
|
|
||||||
import org.gradle.api.attributes.Usage
|
import org.gradle.api.attributes.Usage
|
||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||||
@@ -43,10 +42,6 @@ constructor(
|
|||||||
override lateinit var testRuns: NamedDomainObjectContainer<KotlinJsReportAggregatingTestRun>
|
override lateinit var testRuns: NamedDomainObjectContainer<KotlinJsReportAggregatingTestRun>
|
||||||
internal set
|
internal set
|
||||||
|
|
||||||
init {
|
|
||||||
attributes.attribute(KotlinJsTarget.jsLegacyAttribute, LEGACY)
|
|
||||||
}
|
|
||||||
|
|
||||||
override val kotlinComponents: Set<KotlinTargetComponent> by lazy {
|
override val kotlinComponents: Set<KotlinTargetComponent> by lazy {
|
||||||
if (irTarget == null)
|
if (irTarget == null)
|
||||||
super.kotlinComponents
|
super.kotlinComponents
|
||||||
@@ -176,16 +171,12 @@ constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val jsLegacyAttribute = Attribute.of(
|
val jsModeAttribute = Attribute.of(
|
||||||
"org.jetbrains.kotlin.js.legacy",
|
"org.jetbrains.kotlin.js.mode",
|
||||||
String::class.java
|
String::class.java
|
||||||
)
|
)
|
||||||
|
|
||||||
const val LEGACY = "legacy"
|
const val LEGACY = "legacy"
|
||||||
const val IR = "ir"
|
const val IR = "ir"
|
||||||
|
|
||||||
fun setupAttributesMatchingStrategy(attributesSchema: AttributesSchema) {
|
|
||||||
attributesSchema.attribute(jsLegacyAttribute)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user