Build: Use attributes to resolve test dependencies in jps build mode

This commit is contained in:
Vyacheslav Gerasimov
2020-06-26 19:08:34 +03:00
parent a32f901ab9
commit 77a8cf4e66
10 changed files with 84 additions and 11 deletions
+7 -1
View File
@@ -4,7 +4,13 @@ plugins {
}
val compile by configurations
val fatJarContents by configurations.creating
val fatJarContents by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
}
}
val fatJarContentsStripMetadata by configurations.creating
val fatJarContentsStripServices by configurations.creating
@@ -2,10 +2,22 @@ plugins {
base
}
val sources by configurations.creating
val sources by configurations.creating {
attributes {
isCanBeResolved = true
isCanBeConsumed = false
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.SOURCES))
}
}
}
configurations["embeddedElements"].isCanBeConsumed = false
dependencies {
sources(project(":kotlin-stdlib-common", configuration = "sources"))
sources(project(":kotlin-stdlib-common"))
}
val buildSources by tasks.registering(Jar::class) {