Skip to content

Commit

Permalink
[Gradle] [MPP] CInteropPropagatedDependencies: Consider associate com…
Browse files Browse the repository at this point in the history
…pilations

^KT-48856 Verification Pending
  • Loading branch information
sellmair authored and Space committed Sep 24, 2021
1 parent e7d8804 commit c51d37d
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -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) }
}
}

Expand Down

0 comments on commit c51d37d

Please sign in to comment.