Skip to content

Commit

Permalink
[Gradle] Fix resolve friend paths to be able to detect late associate…
Browse files Browse the repository at this point in the history
…With calls
  • Loading branch information
antohaby authored and qodana-bot committed Jul 8, 2024
1 parent 1b0ab7d commit 1f70ebb
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ internal class DefaultKotlinCompilationFriendPathsResolver(

override fun resolveFriendPaths(compilation: InternalKotlinCompilation<*>): Iterable<FileCollection> {
return mutableListOf<FileCollection>().apply {
compilation.allAssociatedCompilations.forEach {
add(it.output.classesDirs)
val friendsFromAssociatedCompilations = compilation.project.files()
compilation.allAssociatedCompilations.forAll {
friendsFromAssociatedCompilations.from(it.output.classesDirs)
// Adding classes that could be produced to non-default destination for JVM target
// Check KotlinSourceSetProcessor for details
@Suppress("UNCHECKED_CAST")
add(
compilation.project.files(
(it.compileTaskProvider as TaskProvider<KotlinCompileTool>).flatMap { task -> task.destinationDirectory }
)
)
val compileTaskOutput = (it.compileTaskProvider as TaskProvider<KotlinCompileTool>)
.flatMap { task -> task.destinationDirectory }
friendsFromAssociatedCompilations.from(compileTaskOutput)
}
add(friendsFromAssociatedCompilations)
add(friendArtifactResolver.resolveFriendArtifacts(compilation))
}
}
Expand Down

0 comments on commit 1f70ebb

Please sign in to comment.