Fix calculation of target platform for common test modules for NMPP

#KT-34070 Fixed
This commit is contained in:
Andrey Uskov
2019-09-29 22:01:07 +03:00
parent 9af6efcb24
commit c0f2be478f
@@ -614,11 +614,10 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
val platforms = compilations.map { it.platform } val platforms = compilations.map { it.platform }
sourceSet.actualPlatforms.addSimplePlatforms(platforms) sourceSet.actualPlatforms.addSimplePlatforms(platforms)
if (isHMPPEnabled) {
sourceSet.dependsOnSourceSets.mapNotNull { sourceSets[it] }.forEach { sourceSet.dependsOnSourceSets.mapNotNull { sourceSets[it] }.forEach {
it?.actualPlatforms?.addSimplePlatforms(platforms) it?.actualPlatforms?.addSimplePlatforms(platforms)
} }
}
sourceSet.isTestModule = compilations.all { it.isTestModule } sourceSet.isTestModule = compilations.all { it.isTestModule }
} else { } else {
@@ -633,6 +632,10 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
continue continue
} }
} }
if ((! isHMPPEnabled) && sourceSet.actualPlatforms.platforms.size > 1) {
sourceSet.actualPlatforms.addSimplePlatforms(listOf(KotlinPlatform.COMMON))
}
} }
} }