[MPP] Only add test framework dependency once per configuration
^KT-56828
This commit is contained in:
committed by
Space Team
parent
256d9da24c
commit
65649673a7
+20
-19
@@ -93,28 +93,29 @@ private fun KotlinTarget.configureKotlinTestDependency(
|
|||||||
if (platformType in jvmPlatforms) {
|
if (platformType in jvmPlatforms) {
|
||||||
// Checking dependencies which were added via dependsOn(KotlinSourceSet) call
|
// Checking dependencies which were added via dependsOn(KotlinSourceSet) call
|
||||||
// Compilation has own configurations for these that are different from KotlinSourceSet configurations
|
// Compilation has own configurations for these that are different from KotlinSourceSet configurations
|
||||||
KotlinDependencyScope.values()
|
|
||||||
.map { configurations.sourceSetDependencyConfigurationByScope(compilation, it) }
|
|
||||||
.forEach {
|
|
||||||
it.maybeAddTestDependencyCapability(
|
|
||||||
compilation,
|
|
||||||
coreLibrariesVersion,
|
|
||||||
dependencyHandler,
|
|
||||||
tasks
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
compilation.kotlinSourceSets.forEach { sourceSet ->
|
val configurationsToAddTestDependencyTo = linkedSetOf<Configuration>()
|
||||||
|
|
||||||
|
configurationsToAddTestDependencyTo.addAll(
|
||||||
KotlinDependencyScope.values()
|
KotlinDependencyScope.values()
|
||||||
.map { configurations.sourceSetDependencyConfigurationByScope(sourceSet, it) }
|
.map { configurations.sourceSetDependencyConfigurationByScope(compilation, it) }
|
||||||
.forEach {
|
)
|
||||||
it.maybeAddTestDependencyCapability(
|
|
||||||
compilation,
|
configurationsToAddTestDependencyTo.addAll(
|
||||||
coreLibrariesVersion,
|
compilation.kotlinSourceSets.flatMap { sourceSet ->
|
||||||
dependencyHandler,
|
KotlinDependencyScope.values().map {
|
||||||
tasks
|
configurations.sourceSetDependencyConfigurationByScope(sourceSet, it)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
configurationsToAddTestDependencyTo.forEach {
|
||||||
|
it.maybeAddTestDependencyCapability(
|
||||||
|
compilation,
|
||||||
|
coreLibrariesVersion,
|
||||||
|
dependencyHandler,
|
||||||
|
tasks
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user