Build: Fix embedded configuration import in jps build
Should affect only test configurations
This commit is contained in:
+17
-3
@@ -37,10 +37,24 @@ fun JUnit.configureForKotlin() {
|
|||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(mapOf("plugin" to "idea"))
|
apply(mapOf("plugin" to "idea"))
|
||||||
|
// Make Idea import embedded configuration as transitive dependency for some configurations
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
// Make Idea import embedded configuration as transitive dependency
|
listOf(
|
||||||
configurations.findByName("embedded")?.let { embedded ->
|
"testCompile",
|
||||||
configurations.findByName("runtime")?.extendsFrom(embedded)
|
"testCompileOnly",
|
||||||
|
"testRuntime",
|
||||||
|
"testRuntimeOnly"
|
||||||
|
).forEach { configurationName ->
|
||||||
|
val dependencyProjects = configurations
|
||||||
|
.findByName(configurationName)
|
||||||
|
?.dependencies
|
||||||
|
?.mapNotNull { (it as? ProjectDependency)?.dependencyProject }
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
dependencyProjects?.forEach {dependencyProject ->
|
||||||
|
add(configurationName, project(dependencyProject.path, configuration = "embedded"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user