[JS IR] Fix transitive dependency resolve

This commit is contained in:
Roman Artemev
2020-12-24 12:57:30 +03:00
parent 75016bf54d
commit b0adcffed9
3 changed files with 18 additions and 24 deletions
@@ -52,7 +52,6 @@ import org.jetbrains.kotlin.library.*
import org.jetbrains.kotlin.library.impl.BuiltInsPlatform
import org.jetbrains.kotlin.library.impl.buildKotlinLibrary
import org.jetbrains.kotlin.library.resolver.KotlinLibraryResolveResult
import org.jetbrains.kotlin.library.resolver.TopologicalLibraryOrder
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.progress.IncrementalNextRoundException
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
@@ -380,15 +379,10 @@ private class ModulesStructure(
private val friendDependencies: List<KotlinLibrary>
) {
val moduleDependencies: Map<KotlinLibrary, List<KotlinLibrary>> = run {
val result = mutableMapOf<KotlinLibrary, List<KotlinLibrary>>()
allDependencies.forEach { klib, _ ->
val dependencies = allDependencies.filterRoots {
it.library == klib
}.getFullList(TopologicalLibraryOrder)
result.put(klib, dependencies.minus(klib))
}
result
val transitives = allDependencies.getFullResolvedList()
transitives.associate { klib ->
klib.library to klib.resolvedDependencies.map { d -> d.library }
}.toMap()
}
val builtInsDep = allDependencies.getFullList().find { it.isBuiltIns }