[MPP][Test] MPPCompositeMode: Include transitive dependsOn dependencies
^KT-50156
This commit is contained in:
committed by
Space
parent
8880ea1c16
commit
a6bc8807e5
+7
-1
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.resolve.multiplatform.isCommonSource
|
|||||||
import org.jetbrains.kotlin.test.directives.MultiplatformDiagnosticsDirectives.ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE
|
import org.jetbrains.kotlin.test.directives.MultiplatformDiagnosticsDirectives.ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE
|
||||||
import org.jetbrains.kotlin.test.model.*
|
import org.jetbrains.kotlin.test.model.*
|
||||||
import org.jetbrains.kotlin.test.services.*
|
import org.jetbrains.kotlin.test.services.*
|
||||||
|
import org.jetbrains.kotlin.types.typeUtil.closure
|
||||||
|
|
||||||
internal fun MultiplatformAnalysisConfiguration(testServices: TestServices): MultiplatformAnalysisConfiguration {
|
internal fun MultiplatformAnalysisConfiguration(testServices: TestServices): MultiplatformAnalysisConfiguration {
|
||||||
return if (testServices.moduleStructure.allDirectives.contains(ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE)) {
|
return if (testServices.moduleStructure.allDirectives.contains(ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE)) {
|
||||||
@@ -121,7 +122,12 @@ internal class MultiplatformCompositeAnalysisConfiguration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getDependencyDescriptors(module: TestModule): List<ModuleDescriptorImpl> {
|
override fun getDependencyDescriptors(module: TestModule): List<ModuleDescriptorImpl> {
|
||||||
return getDescriptors(module.allDependencies, dependencyProvider, moduleDescriptorProvider)
|
// Transitive dependsOn descriptors should also be returned as dependencies
|
||||||
|
val allDependsOnDependencies = module.dependsOnDependencies.closure(preserveOrder = true) { dependsOnDependency ->
|
||||||
|
dependencyProvider.getTestModule(dependsOnDependency.moduleName).dependsOnDependencies
|
||||||
|
}
|
||||||
|
val allDependencies = (module.allDependencies + allDependsOnDependencies).distinct()
|
||||||
|
return getDescriptors(allDependencies, dependencyProvider, moduleDescriptorProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getDependsOnDescriptors(module: TestModule): List<ModuleDescriptorImpl> {
|
override fun getDependsOnDescriptors(module: TestModule): List<ModuleDescriptorImpl> {
|
||||||
|
|||||||
Reference in New Issue
Block a user