[Gradle] Remove unnecessary sourcesElementsPublishedConfiguration from external target API
This commit is contained in:
committed by
Space Team
parent
45de88abae
commit
ef1e4662f1
-6
@@ -93,12 +93,6 @@ fun KotlinMultiplatformExtension.androidTargetPrototype(): PrototypeAndroidTarge
|
|||||||
configuration.attributes.attribute(TARGET_JVM_ENVIRONMENT_ATTRIBUTE, project.objects.named(TargetJvmEnvironment.ANDROID))
|
configuration.attributes.attribute(TARGET_JVM_ENVIRONMENT_ATTRIBUTE, project.objects.named(TargetJvmEnvironment.ANDROID))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesElementsPublished.configure { _, configuration ->
|
|
||||||
/* TODO w/ Google: Find a way to deprecate this attribute */
|
|
||||||
configuration.attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm)
|
|
||||||
configuration.attributes.attribute(TARGET_JVM_ENVIRONMENT_ATTRIBUTE, project.objects.named(TargetJvmEnvironment.ANDROID))
|
|
||||||
}
|
|
||||||
|
|
||||||
configureIdeImport {
|
configureIdeImport {
|
||||||
registerDependencyResolver(
|
registerDependencyResolver(
|
||||||
AndroidBootClasspathIdeDependencyResolver(project),
|
AndroidBootClasspathIdeDependencyResolver(project),
|
||||||
|
|||||||
-6
@@ -27,7 +27,6 @@ interface ExternalKotlinTargetDescriptor<T : DecoratedExternalKotlinTarget> {
|
|||||||
val sourcesElements: ExternalKotlinTargetConfigurationDescriptor<T>
|
val sourcesElements: ExternalKotlinTargetConfigurationDescriptor<T>
|
||||||
val apiElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>
|
val apiElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>
|
||||||
val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>
|
val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>
|
||||||
val sourcesElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>
|
|
||||||
|
|
||||||
val configure: ((T) -> Unit)?
|
val configure: ((T) -> Unit)?
|
||||||
val configureIdeImport: (IdeMultiplatformImport.() -> Unit)?
|
val configureIdeImport: (IdeMultiplatformImport.() -> Unit)?
|
||||||
@@ -61,9 +60,6 @@ class ExternalKotlinTargetDescriptorBuilder<T : DecoratedExternalKotlinTarget> i
|
|||||||
val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptorBuilder<T> =
|
val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptorBuilder<T> =
|
||||||
ExternalKotlinTargetConfigurationDescriptorBuilder()
|
ExternalKotlinTargetConfigurationDescriptorBuilder()
|
||||||
|
|
||||||
val sourcesElementsPublished: ExternalKotlinTargetConfigurationDescriptorBuilder<T> =
|
|
||||||
ExternalKotlinTargetConfigurationDescriptorBuilder()
|
|
||||||
|
|
||||||
var configure: ((T) -> Unit)? = null
|
var configure: ((T) -> Unit)? = null
|
||||||
|
|
||||||
fun configure(action: (T) -> Unit) {
|
fun configure(action: (T) -> Unit) {
|
||||||
@@ -89,7 +85,6 @@ class ExternalKotlinTargetDescriptorBuilder<T : DecoratedExternalKotlinTarget> i
|
|||||||
sourcesElements = sourcesElements.build(),
|
sourcesElements = sourcesElements.build(),
|
||||||
apiElementsPublished = apiElementsPublished.build(),
|
apiElementsPublished = apiElementsPublished.build(),
|
||||||
runtimeElementsPublished = runtimeElementsPublished.build(),
|
runtimeElementsPublished = runtimeElementsPublished.build(),
|
||||||
sourcesElementsPublished = sourcesElementsPublished.build(),
|
|
||||||
configure = configure,
|
configure = configure,
|
||||||
configureIdeImport = configureIdeImport
|
configureIdeImport = configureIdeImport
|
||||||
)
|
)
|
||||||
@@ -104,7 +99,6 @@ private data class ExternalKotlinTargetDescriptorImpl<T : DecoratedExternalKotli
|
|||||||
override val sourcesElements: ExternalKotlinTargetConfigurationDescriptor<T>,
|
override val sourcesElements: ExternalKotlinTargetConfigurationDescriptor<T>,
|
||||||
override val apiElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>,
|
override val apiElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>,
|
||||||
override val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>,
|
override val runtimeElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>,
|
||||||
override val sourcesElementsPublished: ExternalKotlinTargetConfigurationDescriptor<T>,
|
|
||||||
override val configure: ((T) -> Unit)?,
|
override val configure: ((T) -> Unit)?,
|
||||||
override val configureIdeImport: (IdeMultiplatformImport.() -> Unit)?,
|
override val configureIdeImport: (IdeMultiplatformImport.() -> Unit)?,
|
||||||
) : ExternalKotlinTargetDescriptor<T>
|
) : ExternalKotlinTargetDescriptor<T>
|
||||||
|
|||||||
-1
@@ -31,7 +31,6 @@ internal class ExternalKotlinTargetImpl internal constructor(
|
|||||||
val sourcesElementsConfiguration: Configuration,
|
val sourcesElementsConfiguration: Configuration,
|
||||||
val apiElementsPublishedConfiguration: Configuration,
|
val apiElementsPublishedConfiguration: Configuration,
|
||||||
val runtimeElementsPublishedConfiguration: Configuration,
|
val runtimeElementsPublishedConfiguration: Configuration,
|
||||||
val sourcesElementsPublishedConfiguration: Configuration,
|
|
||||||
val kotlinTargetComponent: ExternalKotlinTargetComponent,
|
val kotlinTargetComponent: ExternalKotlinTargetComponent,
|
||||||
private val artifactsTaskLocator: ArtifactsTaskLocator,
|
private val artifactsTaskLocator: ArtifactsTaskLocator,
|
||||||
) : InternalKotlinTarget {
|
) : InternalKotlinTarget {
|
||||||
|
|||||||
+2
-10
@@ -16,10 +16,10 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImport
|
import org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImport
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.configureSourcesPublicationAttributes
|
import org.jetbrains.kotlin.gradle.plugin.mpp.configureSourcesPublicationAttributes
|
||||||
import org.jetbrains.kotlin.gradle.utils.markConsumable
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.usesPlatformOf
|
import org.jetbrains.kotlin.gradle.plugin.usesPlatformOf
|
||||||
import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
|
import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
|
||||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||||
|
import org.jetbrains.kotlin.gradle.utils.markConsumable
|
||||||
import org.jetbrains.kotlin.gradle.utils.named
|
import org.jetbrains.kotlin.gradle.utils.named
|
||||||
|
|
||||||
@ExternalKotlinTargetApi
|
@ExternalKotlinTargetApi
|
||||||
@@ -37,9 +37,6 @@ fun <T : DecoratedExternalKotlinTarget> KotlinMultiplatformExtension.createExter
|
|||||||
val runtimeElementsPublishedConfiguration =
|
val runtimeElementsPublishedConfiguration =
|
||||||
project.configurations.maybeCreate(lowerCamelCaseName(descriptor.targetName, "runtimeElements-published"))
|
project.configurations.maybeCreate(lowerCamelCaseName(descriptor.targetName, "runtimeElements-published"))
|
||||||
|
|
||||||
val sourcesElementsPublishedConfiguration =
|
|
||||||
project.configurations.maybeCreate(lowerCamelCaseName(descriptor.targetName, "sourcesElements-published"))
|
|
||||||
|
|
||||||
val kotlinTargetComponent = ExternalKotlinTargetComponent(
|
val kotlinTargetComponent = ExternalKotlinTargetComponent(
|
||||||
ExternalKotlinTargetComponent.TargetProvider.byTargetName(this, descriptor.targetName)
|
ExternalKotlinTargetComponent.TargetProvider.byTargetName(this, descriptor.targetName)
|
||||||
)
|
)
|
||||||
@@ -59,7 +56,6 @@ fun <T : DecoratedExternalKotlinTarget> KotlinMultiplatformExtension.createExter
|
|||||||
sourcesElementsConfiguration = sourcesElementsConfiguration,
|
sourcesElementsConfiguration = sourcesElementsConfiguration,
|
||||||
apiElementsPublishedConfiguration = apiElementsPublishedConfiguration,
|
apiElementsPublishedConfiguration = apiElementsPublishedConfiguration,
|
||||||
runtimeElementsPublishedConfiguration = runtimeElementsPublishedConfiguration,
|
runtimeElementsPublishedConfiguration = runtimeElementsPublishedConfiguration,
|
||||||
sourcesElementsPublishedConfiguration = sourcesElementsPublishedConfiguration,
|
|
||||||
kotlinTargetComponent = kotlinTargetComponent,
|
kotlinTargetComponent = kotlinTargetComponent,
|
||||||
artifactsTaskLocator = artifactsTaskLocator
|
artifactsTaskLocator = artifactsTaskLocator
|
||||||
)
|
)
|
||||||
@@ -69,18 +65,15 @@ fun <T : DecoratedExternalKotlinTarget> KotlinMultiplatformExtension.createExter
|
|||||||
target.setupRuntimeElements(runtimeElementsConfiguration)
|
target.setupRuntimeElements(runtimeElementsConfiguration)
|
||||||
target.setupRuntimeElements(runtimeElementsPublishedConfiguration)
|
target.setupRuntimeElements(runtimeElementsPublishedConfiguration)
|
||||||
target.setupSourcesElements(sourcesElementsConfiguration)
|
target.setupSourcesElements(sourcesElementsConfiguration)
|
||||||
target.setupSourcesElements(sourcesElementsPublishedConfiguration)
|
|
||||||
apiElementsConfiguration.markConsumable()
|
apiElementsConfiguration.markConsumable()
|
||||||
runtimeElementsConfiguration.markConsumable()
|
runtimeElementsConfiguration.markConsumable()
|
||||||
sourcesElementsConfiguration.markConsumable()
|
sourcesElementsConfiguration.markConsumable()
|
||||||
|
|
||||||
/* Those configurations can not be resolved but also not consumed (not suitable for project to proejct dependencies */
|
/* Those configurations can not be resolved but also not consumed (not suitable for project to project dependencies) */
|
||||||
apiElementsPublishedConfiguration.isCanBeConsumed = false
|
apiElementsPublishedConfiguration.isCanBeConsumed = false
|
||||||
apiElementsPublishedConfiguration.isCanBeResolved = false
|
apiElementsPublishedConfiguration.isCanBeResolved = false
|
||||||
runtimeElementsPublishedConfiguration.isCanBeResolved = false
|
runtimeElementsPublishedConfiguration.isCanBeResolved = false
|
||||||
runtimeElementsPublishedConfiguration.isCanBeConsumed = false
|
runtimeElementsPublishedConfiguration.isCanBeConsumed = false
|
||||||
sourcesElementsPublishedConfiguration.isCanBeResolved = false
|
|
||||||
sourcesElementsPublishedConfiguration.isCanBeConsumed = false
|
|
||||||
|
|
||||||
val decorated = descriptor.targetFactory.create(DecoratedExternalKotlinTarget.Delegate(target))
|
val decorated = descriptor.targetFactory.create(DecoratedExternalKotlinTarget.Delegate(target))
|
||||||
target.onCreated()
|
target.onCreated()
|
||||||
@@ -91,7 +84,6 @@ fun <T : DecoratedExternalKotlinTarget> KotlinMultiplatformExtension.createExter
|
|||||||
descriptor.sourcesElements.configure?.invoke(decorated, sourcesElementsConfiguration)
|
descriptor.sourcesElements.configure?.invoke(decorated, sourcesElementsConfiguration)
|
||||||
descriptor.apiElementsPublished.configure?.invoke(decorated, apiElementsPublishedConfiguration)
|
descriptor.apiElementsPublished.configure?.invoke(decorated, apiElementsPublishedConfiguration)
|
||||||
descriptor.runtimeElementsPublished.configure?.invoke(decorated, runtimeElementsPublishedConfiguration)
|
descriptor.runtimeElementsPublished.configure?.invoke(decorated, runtimeElementsPublishedConfiguration)
|
||||||
descriptor.sourcesElementsPublished.configure?.invoke(decorated, sourcesElementsPublishedConfiguration)
|
|
||||||
descriptor.configureIdeImport?.invoke(project.kotlinIdeMultiplatformImport)
|
descriptor.configureIdeImport?.invoke(project.kotlinIdeMultiplatformImport)
|
||||||
|
|
||||||
targets.add(decorated)
|
targets.add(decorated)
|
||||||
|
|||||||
Reference in New Issue
Block a user