diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt index 520bf8f9ff9..d2431961b54 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt @@ -785,16 +785,7 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { } } - // TODO DISCUSS AT REVIEW: can we simplify it to: - // sourceSet.isTestModule = importingContext.compilationsBySourceSet(sourceSet)?.all { it.isTestModule} ?: false - // ^ - // | - // sic! - // The difference from the current behaviour would be in case if source set is not included into any compilation AND - // KotlinSourceSetImpl.defaultIsTestModule is set to 'true'. Though I don't know who and why would do that. - importingContext.compilationsBySourceSet(sourceSet)?.all { it.isTestModule }?.let { isTest -> - sourceSet.isTestModule = isTest - } + sourceSet.isTestModule = importingContext.compilationsBySourceSet(sourceSet)?.all { it.isTestModule } ?: false importingContext.compilationsBySourceSet(sourceSet)?.let { compilations -> val platforms = compilations.map { it.platform } diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt index 32b66df33b8..de3b3572f08 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt @@ -36,7 +36,6 @@ class KotlinSourceSetImpl( override val dependencies: Array, override val dependsOnSourceSets: Set, val defaultPlatform: KotlinPlatformContainerImpl = KotlinPlatformContainerImpl(), - val defaultIsTestModule: Boolean = false ) : KotlinSourceSet { constructor(kotlinSourceSet: KotlinSourceSet, cloningCache: MutableMap) : this( @@ -46,14 +45,15 @@ class KotlinSourceSetImpl( HashSet(kotlinSourceSet.resourceDirs), kotlinSourceSet.dependencies, HashSet(kotlinSourceSet.dependsOnSourceSets), - KotlinPlatformContainerImpl(kotlinSourceSet.actualPlatforms), - kotlinSourceSet.isTestModule - ) + KotlinPlatformContainerImpl(kotlinSourceSet.actualPlatforms) + ) { + this.isTestModule = kotlinSourceSet.isTestModule + } override var actualPlatforms: KotlinPlatformContainer = defaultPlatform internal set - override var isTestModule: Boolean = defaultIsTestModule + override var isTestModule: Boolean = false internal set override fun toString() = name