Skip to content

Commit 82152a6

Browse files
committed
More configuration avoidance
1 parent b9df474 commit 82152a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kotlinx-coroutines-debug/build.gradle.kts

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ tasks.withType<Test>().configureEach {
5454
}
5555
}
5656

57-
val jar by tasks.getting(Jar::class) {
57+
val jar by tasks.existing(Jar::class) {
5858
enabled = false
5959
}
6060

6161
val versionFileTask = VersionFile.registerVersionFileTask(project)
6262

63-
val shadowJar by tasks.getting(ShadowJar::class) {
63+
val shadowJar by tasks.existing(ShadowJar::class) {
6464
// Shadow only byte buddy, do not package kotlin stdlib
6565
configurations = listOf(project.configurations["shadowDeps"])
6666
relocate("net.bytebuddy", "kotlinx.coroutines.repackaged.net.bytebuddy") {
@@ -73,8 +73,8 @@ val shadowJar by tasks.getting(ShadowJar::class) {
7373
from the `jar` task is not present when the compilaton finishes, even if the file with this name exists. */
7474
archiveClassifier.convention(null as String?)
7575
archiveClassifier.set(null as String?)
76-
archiveBaseName.set(jar.archiveBaseName)
77-
archiveVersion.set(jar.archiveVersion)
76+
archiveBaseName.set(jar.flatMap { it.archiveBaseName })
77+
archiveVersion.set(jar.flatMap { it.archiveVersion })
7878
manifest {
7979
attributes(mapOf(
8080
"Premain-Class" to "kotlinx.coroutines.debug.AgentPremain",
@@ -88,7 +88,7 @@ val shadowJar by tasks.getting(ShadowJar::class) {
8888
doLast {
8989
// add module-info.class to the META-INF/versions/9/ directory.
9090
// We can't do that directly with the shadowJar task because it doesn't support replacing existing files.
91-
val zipPath = this@getting.outputs.files.singleFile.toPath()
91+
val zipPath = this@existing.outputs.files.singleFile.toPath()
9292
val zipUri = URI.create("jar:${zipPath.toUri()}")
9393
println(tasks.compileModuleInfoJava.get().outputs.files.asFileTree.toList())
9494
val moduleInfoFilePath = tasks.compileModuleInfoJava.get().outputs.files.asFileTree.matching {

0 commit comments

Comments
 (0)