From 0608c50e27ac3cb689e84608c4dc3cb63d83af46 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 29 Dec 2020 11:25:19 +0300 Subject: [PATCH] [Test] Properly configure dependencies for common modules in ModuleStructureExtractor --- .../test/services/impl/ModuleStructureExtractorImpl.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt index cc42177d94c..d4718038f65 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.test.services.impl import org.jetbrains.kotlin.platform.CommonPlatforms import org.jetbrains.kotlin.platform.TargetPlatform +import org.jetbrains.kotlin.platform.isCommon import org.jetbrains.kotlin.platform.js.JsPlatforms import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.platform.konan.NativePlatforms @@ -156,6 +157,10 @@ class ModuleStructureExtractorImpl( val (moduleName, dependencies, friends) = splitRawModuleStringToNameAndDependencies(values.joinToString(separator = " ")) currentModuleName = moduleName dependencies.mapTo(dependenciesOfCurrentModule) { name -> + val dependentModule = modules.firstOrNull { it.name == name } + if (dependentModule?.targetPlatform.isCommon()) { + return@mapTo DependencyDescription(name, DependencyKind.Source, DependencyRelation.DependsOn) + } val kind = defaultsProvider.defaultDependencyKind DependencyDescription(name, kind, DependencyRelation.Dependency) }