Skip to content

Commit 3d343e7

Browse files
committed
Fix debug module publication with shadow plugin
Fixes #3345 Fixes #3334
1 parent 7934032 commit 3d343e7

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

gradle/publish.gradle

+1-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ publishing {
4545
// Configure java publications for regular non-MPP modules
4646
publications {
4747
maven(MavenPublication) {
48-
if (project.name == "kotlinx-coroutines-debug") {
49-
project.shadow.component(it)
50-
} else {
51-
from components.java
52-
}
48+
from components.java
5349
artifact sourcesJar
5450
}
5551
}

kotlinx-coroutines-debug/build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ configurations {
88
shadowDeps // shaded dependencies, not included into the resulting .pom file
99
compileOnly.extendsFrom(shadowDeps)
1010
runtimeOnly.extendsFrom(shadowDeps)
11-
12-
/*
13-
* It is possible to extend a particular configuration with shadow,
14-
* but in that case it changes dependency type to "runtime" and resolves it
15-
* (so it cannot be further modified). Otherwise, shadow just ignores all dependencies.
16-
*/
17-
shadow.extendsFrom(api) // shadow - resulting configuration with shaded jar file
18-
configureKotlinJvmPlatform(shadow)
1911
}
2012

2113
dependencies {
@@ -39,19 +31,27 @@ java {
3931
}
4032

4133
jar {
34+
setEnabled(false)
4235
manifest {
4336
attributes "Premain-Class": "kotlinx.coroutines.debug.AgentPremain"
4437
attributes "Can-Redefine-Classes": "true"
4538
}
4639
}
4740

48-
shadowJar {
41+
def shadowJarTask = shadowJar {
4942
classifier null
5043
// Shadow only byte buddy, do not package kotlin stdlib
5144
configurations = [project.configurations.shadowDeps]
5245
relocate('net.bytebuddy', 'kotlinx.coroutines.repackaged.net.bytebuddy')
5346
}
5447

48+
configurations {
49+
artifacts {
50+
add("apiElements", shadowJarTask)
51+
add("runtimeElements", shadowJarTask)
52+
}
53+
}
54+
5555
def commonKoverExcludes =
5656
// Never used, safety mechanism
5757
["kotlinx.coroutines.debug.internal.NoOpProbesKt"]

0 commit comments

Comments
 (0)