@@ -54,13 +54,13 @@ tasks.withType<Test>().configureEach {
54
54
}
55
55
}
56
56
57
- val jar by tasks.getting (Jar ::class ) {
57
+ val jar by tasks.existing (Jar ::class ) {
58
58
enabled = false
59
59
}
60
60
61
61
val versionFileTask = VersionFile .registerVersionFileTask(project)
62
62
63
- val shadowJar by tasks.getting (ShadowJar ::class ) {
63
+ val shadowJar by tasks.existing (ShadowJar ::class ) {
64
64
// Shadow only byte buddy, do not package kotlin stdlib
65
65
configurations = listOf (project.configurations[" shadowDeps" ])
66
66
relocate(" net.bytebuddy" , " kotlinx.coroutines.repackaged.net.bytebuddy" ) {
@@ -73,8 +73,8 @@ val shadowJar by tasks.getting(ShadowJar::class) {
73
73
from the `jar` task is not present when the compilaton finishes, even if the file with this name exists. */
74
74
archiveClassifier.convention(null as String? )
75
75
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 } )
78
78
manifest {
79
79
attributes(mapOf (
80
80
" Premain-Class" to " kotlinx.coroutines.debug.AgentPremain" ,
@@ -88,7 +88,7 @@ val shadowJar by tasks.getting(ShadowJar::class) {
88
88
doLast {
89
89
// add module-info.class to the META-INF/versions/9/ directory.
90
90
// 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()
92
92
val zipUri = URI .create(" jar:${zipPath.toUri()} " )
93
93
println (tasks.compileModuleInfoJava.get().outputs.files.asFileTree.toList())
94
94
val moduleInfoFilePath = tasks.compileModuleInfoJava.get().outputs.files.asFileTree.matching {
0 commit comments