Fixed import of MPP project with single Android target
#KT-34639 Fixed
This commit is contained in:
@@ -668,6 +668,18 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
|
||||
}
|
||||
|
||||
for (sourceSet in sourceSets.values) {
|
||||
if (!isHMPPEnabled) {
|
||||
val name = sourceSet.name
|
||||
if (name == KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME) {
|
||||
sourceSet.isTestModule = false
|
||||
continue
|
||||
}
|
||||
if (name == KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME) {
|
||||
sourceSet.isTestModule = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
(allSourceSetToCompilations[sourceSet]?.all { it.isTestModule }
|
||||
?: if (!isHMPPEnabled && sourceSet.name == KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME) true else null)?.let { isTest ->
|
||||
sourceSet.isTestModule = isTest
|
||||
|
||||
@@ -242,7 +242,13 @@ class KotlinPlatformContainerImpl() : KotlinPlatformContainer {
|
||||
override fun supports(simplePlatform: KotlinPlatform): Boolean = platforms.contains(simplePlatform)
|
||||
|
||||
override fun addSimplePlatforms(platforms: Collection<KotlinPlatform>) {
|
||||
(myPlatforms ?: HashSet<KotlinPlatform>().apply { myPlatforms = this }).addAll(platforms)
|
||||
(myPlatforms ?: HashSet<KotlinPlatform>().apply { myPlatforms = this }).let {
|
||||
it.addAll(platforms)
|
||||
if (it.contains(KotlinPlatform.COMMON)) {
|
||||
it.clear()
|
||||
it.addAll(defaultCommonPlatform)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user