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
+9 -1
View File
@@ -10,6 +10,14 @@ plugins {
base
}
val runtimeElements by configurations.creating {
isCanBeResolved = false
isCanBeConsumed = true
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
}
}
val JDK_18: String by rootProject.extra
val toolsJarFile = toolsJarFile(jdkHome = File(JDK_18)) ?: error("Couldn't find tools.jar in $JDK_18")
@@ -75,4 +83,4 @@ val jar = tasks.register<Jar>("jar") {
}
}
artifacts.add("default", jar)
artifacts.add(runtimeElements.name, jar)