MPP: Force COMMON platform for commonMain/commonTest source sets

Follow-up for 172/AS3.1 bunches
This commit is contained in:
Alexey Sedunov
2018-09-10 18:51:24 +03:00
parent 863c0051ce
commit a417630c24
2 changed files with 24 additions and 0 deletions
@@ -297,6 +297,18 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
}
}
for (sourceSet in sourceSets) {
val name = sourceSet.name
if (name == KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME) {
sourceSet.platform = KotlinPlatform.COMMON
sourceSet.isTestModule = false
continue
}
if (name == KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME) {
sourceSet.platform = KotlinPlatform.COMMON
sourceSet.isTestModule = true
continue
}
val compilations = sourceSetToCompilations[sourceSet]
if (compilations != null) {
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON
@@ -297,6 +297,18 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
}
}
for (sourceSet in sourceSets) {
val name = sourceSet.name
if (name == KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME) {
sourceSet.platform = KotlinPlatform.COMMON
sourceSet.isTestModule = false
continue
}
if (name == KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME) {
sourceSet.platform = KotlinPlatform.COMMON
sourceSet.isTestModule = true
continue
}
val compilations = sourceSetToCompilations[sourceSet]
if (compilations != null) {
sourceSet.platform = compilations.map { it.platform }.distinct().singleOrNull() ?: KotlinPlatform.COMMON