Build: Import embedded configuration as runtime in JPS build
This makes Idea import all embedded modules as transitive dependencies #KT-29548
This commit is contained in:
@@ -35,6 +35,12 @@ fun org.jetbrains.gradle.ext.JUnit.configureForKotlin() {
|
|||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(mapOf("plugin" to "idea"))
|
apply(mapOf("plugin" to "idea"))
|
||||||
|
afterEvaluate {
|
||||||
|
// Make Idea import embedded configuration as transitive dependency
|
||||||
|
configurations.findByName("embedded")?.let { embedded ->
|
||||||
|
configurations.findByName("runtime")?.extendsFrom(embedded)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
|
|||||||
@@ -208,11 +208,7 @@ tasks.getByName("check").dependsOn(dexMethodCount)
|
|||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
listOf(mainJar.name, "runtime", "archives").forEach { configurationName ->
|
listOf(mainJar.name, "runtime", "archives").forEach { configurationName ->
|
||||||
add(
|
add(configurationName, result)
|
||||||
configurationName,
|
|
||||||
// idea can correctly import configurations of shadowJar as transitive dependencies which are required by tests
|
|
||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) reflectShadowJar else result
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add("archives", modularJar)
|
add("archives", modularJar)
|
||||||
|
|||||||
Reference in New Issue
Block a user