From d4177f167b002918689e5f8cdc8d48534d6c99bd Mon Sep 17 00:00:00 2001 From: Sebastian Sellmair Date: Thu, 8 Dec 2022 12:53:54 +0100 Subject: [PATCH] [Gradle] ResolvedMppVariantsProvider: Use dependent.selected instead of requested... ... in order to support dependencySubstitutions KT-52172 --- .../gradle/plugin/mpp/ResolvedMppVariantsProvider.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/ResolvedMppVariantsProvider.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/ResolvedMppVariantsProvider.kt index acf9b09d710..2ec8565124c 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/ResolvedMppVariantsProvider.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/ResolvedMppVariantsProvider.kt @@ -106,13 +106,12 @@ internal class ResolvedMppVariantsProvider private constructor(private val proje val result = mutableListOf() configuration.incoming.resolutionResult.allComponents { component -> - val isMpp = - component.dependents.isNotEmpty() && // filter out the root of the dependency graph, we are not interested in it - component.variants.any { variant -> variant.attributes.keySet().any { it.name == KotlinPlatformType.attribute.name } } + val isMpp = component.dependents.isNotEmpty() && // filter out the root of the dependency graph, we are not interested in it + component.variants.any { variant -> variant.attributes.keySet().any { it.name == KotlinPlatformType.attribute.name } } if (isMpp) { result.add(component) component.dependents.forEach { dependent -> - dependent.requested.toKpmModuleIdentifiers().forEach { moduleId -> + dependent.selected.toKpmModuleIdentifiers().forEach { moduleId -> val moduleEntry = getEntryForModule(moduleId) moduleEntry.resolvedVariantsByConfiguration[configuration] = listOf(dependent.resolvedVariant)