[Gradle][Minor] Move KotlinTargetComponent into separate source file
KT-54981
This commit is contained in:
committed by
Space Team
parent
7368752c24
commit
e5398e6be7
-9
@@ -11,21 +11,12 @@ import org.gradle.api.Action
|
|||||||
import org.gradle.api.Named
|
import org.gradle.api.Named
|
||||||
import org.gradle.api.NamedDomainObjectContainer
|
import org.gradle.api.NamedDomainObjectContainer
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.PublishArtifact
|
|
||||||
import org.gradle.api.attributes.AttributeContainer
|
import org.gradle.api.attributes.AttributeContainer
|
||||||
import org.gradle.api.attributes.HasAttributes
|
import org.gradle.api.attributes.HasAttributes
|
||||||
import org.gradle.api.component.SoftwareComponent
|
import org.gradle.api.component.SoftwareComponent
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptionsDeprecated
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptionsDeprecated
|
||||||
|
|
||||||
interface KotlinTargetComponent : SoftwareComponent {
|
|
||||||
val target: KotlinTarget
|
|
||||||
val publishable: Boolean
|
|
||||||
val publishableOnCurrentHost: Boolean
|
|
||||||
val defaultArtifactId: String
|
|
||||||
val sourcesArtifacts: Set<PublishArtifact>
|
|
||||||
}
|
|
||||||
|
|
||||||
interface KotlinTarget : Named, HasAttributes {
|
interface KotlinTarget : Named, HasAttributes {
|
||||||
val targetName: String
|
val targetName: String
|
||||||
val disambiguationClassifier: String? get() = targetName
|
val disambiguationClassifier: String? get() = targetName
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.gradle.plugin
|
||||||
|
|
||||||
|
import org.gradle.api.artifacts.PublishArtifact
|
||||||
|
import org.gradle.api.component.SoftwareComponent
|
||||||
|
|
||||||
|
interface KotlinTargetComponent : SoftwareComponent {
|
||||||
|
val target: KotlinTarget
|
||||||
|
val publishable: Boolean
|
||||||
|
val publishableOnCurrentHost: Boolean
|
||||||
|
val defaultArtifactId: String
|
||||||
|
val sourcesArtifacts: Set<PublishArtifact>
|
||||||
|
}
|
||||||
+4
@@ -42,10 +42,14 @@ fun <T : DecoratedExternalKotlinTarget> KotlinMultiplatformExtension.createExter
|
|||||||
artifactsTaskLocator = artifactsTaskLocator
|
artifactsTaskLocator = artifactsTaskLocator
|
||||||
)
|
)
|
||||||
|
|
||||||
|
apiElementsConfiguration.isCanBeConsumed = true
|
||||||
|
apiElementsConfiguration.isCanBeResolved = false
|
||||||
apiElementsConfiguration.usesPlatformOf(target)
|
apiElementsConfiguration.usesPlatformOf(target)
|
||||||
apiElementsConfiguration.attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.producerApiUsage(target))
|
apiElementsConfiguration.attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.producerApiUsage(target))
|
||||||
apiElementsConfiguration.attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
apiElementsConfiguration.attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||||
|
|
||||||
|
runtimeElementsConfiguration.isCanBeConsumed = true
|
||||||
|
runtimeElementsConfiguration.isCanBeResolved = false
|
||||||
runtimeElementsConfiguration.usesPlatformOf(target)
|
runtimeElementsConfiguration.usesPlatformOf(target)
|
||||||
runtimeElementsConfiguration.attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.producerRuntimeUsage(target))
|
runtimeElementsConfiguration.attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.producerRuntimeUsage(target))
|
||||||
runtimeElementsConfiguration.attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
runtimeElementsConfiguration.attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||||
|
|||||||
Reference in New Issue
Block a user