From 730ba811f65606ed2c279b99904261f82a8bd88b Mon Sep 17 00:00:00 2001 From: Sergey Igushkin Date: Tue, 1 Feb 2022 00:51:34 +0400 Subject: [PATCH] KPM: filter out duplicates from directRefinesDependencies --- .../kotlin/gradle/plugin/mpp/pm20/KotlinGradleFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/KotlinGradleFragment.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/KotlinGradleFragment.kt index 8ab940e77aa..103190957c7 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/KotlinGradleFragment.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/KotlinGradleFragment.kt @@ -84,8 +84,11 @@ open class KotlinGradleFragmentInternal @Inject constructor( private val _directRefinesDependencies = mutableSetOf>() override val directRefinesDependencies: Iterable - get() = _directRefinesDependencies.map { it.get() } + get() = _directRefinesDependencies.map { it.get() }.toSet() + // TODO: separate the declared module dependencies and exported module dependencies? we need this to keep implementation dependencies + // out of the consumer's metadata compilations compile classpath; however, Native variants must expose implementation as API + // anyway, so for now all fragments follow that behavior override val declaredModuleDependencies: Iterable get() = listOf(apiConfiguration, implementationConfiguration).flatMapTo(mutableSetOf()) { it.allDependencies.map { it.toModuleDependency(project) }