Remove unused KotlinSourceSetImpl.defaultIsTestModule; simplify logic of test modules detection
^KT-37127
This commit is contained in:
@@ -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
|
||||||
// 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
|
|
||||||
}
|
|
||||||
|
|
||||||
importingContext.compilationsBySourceSet(sourceSet)?.let { compilations ->
|
importingContext.compilationsBySourceSet(sourceSet)?.let { compilations ->
|
||||||
val platforms = compilations.map { it.platform }
|
val platforms = compilations.map { it.platform }
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class KotlinSourceSetImpl(
|
|||||||
override val dependencies: Array<KotlinDependencyId>,
|
override val dependencies: Array<KotlinDependencyId>,
|
||||||
override val dependsOnSourceSets: Set<String>,
|
override val dependsOnSourceSets: Set<String>,
|
||||||
val defaultPlatform: KotlinPlatformContainerImpl = KotlinPlatformContainerImpl(),
|
val defaultPlatform: KotlinPlatformContainerImpl = KotlinPlatformContainerImpl(),
|
||||||
val defaultIsTestModule: Boolean = false
|
|
||||||
) : KotlinSourceSet {
|
) : KotlinSourceSet {
|
||||||
|
|
||||||
constructor(kotlinSourceSet: KotlinSourceSet, cloningCache: MutableMap<Any, Any>) : this(
|
constructor(kotlinSourceSet: KotlinSourceSet, cloningCache: MutableMap<Any, Any>) : this(
|
||||||
@@ -46,14 +45,15 @@ class KotlinSourceSetImpl(
|
|||||||
HashSet(kotlinSourceSet.resourceDirs),
|
HashSet(kotlinSourceSet.resourceDirs),
|
||||||
kotlinSourceSet.dependencies,
|
kotlinSourceSet.dependencies,
|
||||||
HashSet(kotlinSourceSet.dependsOnSourceSets),
|
HashSet(kotlinSourceSet.dependsOnSourceSets),
|
||||||
KotlinPlatformContainerImpl(kotlinSourceSet.actualPlatforms),
|
KotlinPlatformContainerImpl(kotlinSourceSet.actualPlatforms)
|
||||||
kotlinSourceSet.isTestModule
|
) {
|
||||||
)
|
this.isTestModule = kotlinSourceSet.isTestModule
|
||||||
|
}
|
||||||
|
|
||||||
override var actualPlatforms: KotlinPlatformContainer = defaultPlatform
|
override var actualPlatforms: KotlinPlatformContainer = defaultPlatform
|
||||||
internal set
|
internal set
|
||||||
|
|
||||||
override var isTestModule: Boolean = defaultIsTestModule
|
override var isTestModule: Boolean = false
|
||||||
internal set
|
internal set
|
||||||
|
|
||||||
override fun toString() = name
|
override fun toString() = name
|
||||||
|
|||||||
Reference in New Issue
Block a user