From 379ab23894948681364912f76a3c72bfdddc99c3 Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Mon, 17 Apr 2023 00:10:28 +0200 Subject: [PATCH 1/2] disable publication of shadowRuntimeElements variant --- .../org/jetbrains/conventions/maven-publish.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts index f4baa3e9fe..a56eabaa95 100644 --- a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts +++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts @@ -1,5 +1,7 @@ package org.jetbrains.conventions +import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin + plugins { id("org.jetbrains.conventions.base") `maven-publish` @@ -56,3 +58,9 @@ publishing { } } } + +plugins.withType().configureEach { + // manually disable publication of Shadow elements https://github.com/johnrengelman/shadow/issues/651#issue-839148311 + val javaComponent = components["java"] as AdhocComponentWithVariants + javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() } +} From 94c75e7804d1bf1f6f68c00b8c91e070ea440eab Mon Sep 17 00:00:00 2001 From: aSemy <897017+aSemy@users.noreply.github.com> Date: Mon, 17 Apr 2023 14:37:44 +0200 Subject: [PATCH 2/2] Update build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts Co-authored-by: Ignat Beresnev --- .../kotlin/org/jetbrains/conventions/maven-publish.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts index a56eabaa95..9b7169f6f7 100644 --- a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts +++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts @@ -61,6 +61,8 @@ publishing { plugins.withType().configureEach { // manually disable publication of Shadow elements https://github.com/johnrengelman/shadow/issues/651#issue-839148311 + // This is done to preserve compatibility and have the same behaviour as previous versions of Dokka. + // For more details, see https://github.com/Kotlin/dokka/pull/2704#issuecomment-1499517930 val javaComponent = components["java"] as AdhocComponentWithVariants javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() } }