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) {
|
||||
allprojects {
|
||||
apply(mapOf("plugin" to "idea"))
|
||||
// Make Idea import embedded configuration as transitive dependency for some configurations
|
||||
afterEvaluate {
|
||||
// Make Idea import embedded configuration as transitive dependency
|
||||
configurations.findByName("embedded")?.let { embedded ->
|
||||
configurations.findByName("runtime")?.extendsFrom(embedded)
|
||||
listOf(
|
||||
"testCompile",
|
||||
"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