[Gradle] [MPP] CInteropPropagatedDependencies: Consider associate compilations

^KT-48856 Verification Pending
This commit is contained in:
sebastian.sellmair
2021-09-24 10:08:10 +02:00
committed by Space
parent e7d8804bdf
commit c51d37d65d
@@ -67,9 +67,11 @@ private fun Project.getPropagatedCInteropDependenciesOrEmpty(sourceSet: DefaultK
/* Participating in multiple compilations? -> can't propagate -> should be commonized */
val compilation = compilations.singleOrNull() as? KotlinNativeCompilation ?: return@files emptySet<File>()
/* Source Set is directly included in compilation -> No need to add dependency again (will be handled already) */
if (sourceSet in compilation.kotlinSourceSets) return@files emptySet<File>()
getAllCInteropOutputFiles(compilation)
(compilation.associateWith + compilation)
.filterIsInstance<KotlinNativeCompilation>()
/* Source Set is directly included in compilation -> No need to add dependency again (will be handled already) */
.filter { relevantCompilation -> sourceSet !in relevantCompilation.kotlinSourceSets }
.map { relevantCompilation -> getAllCInteropOutputFiles(relevantCompilation) }
}
}