From c0f2be478f395298f7532fb8f67198685680bbfd Mon Sep 17 00:00:00 2001 From: Andrey Uskov Date: Sun, 29 Sep 2019 22:01:07 +0300 Subject: [PATCH] Fix calculation of target platform for common test modules for NMPP #KT-34070 Fixed --- .../src/KotlinMPPGradleModelBuilder.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt index 2e5e7f729ce..7b5ce7570ee 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt @@ -614,12 +614,11 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { val platforms = compilations.map { it.platform } sourceSet.actualPlatforms.addSimplePlatforms(platforms) - if (isHMPPEnabled) { - sourceSet.dependsOnSourceSets.mapNotNull { sourceSets[it] }.forEach { - it?.actualPlatforms?.addSimplePlatforms(platforms) - } + sourceSet.dependsOnSourceSets.mapNotNull { sourceSets[it] }.forEach { + it?.actualPlatforms?.addSimplePlatforms(platforms) } + sourceSet.isTestModule = compilations.all { it.isTestModule } } else { //TODO(auskov): remove this branch as far as import of orphan source sets is dropped @@ -633,6 +632,10 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { continue } } + + if ((! isHMPPEnabled) && sourceSet.actualPlatforms.platforms.size > 1) { + sourceSet.actualPlatforms.addSimplePlatforms(listOf(KotlinPlatform.COMMON)) + } } }