From bafe3e8886c41239547587dd4952acbc2e65bfbb Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Fri, 14 Jan 2022 16:43:04 +0100 Subject: [PATCH] Add dokkaJar to all artifacts --- bom/build.gradle.kts | 37 ------------------- .../main/kotlin/lavalink-module.gradle.kts | 1 + .../kotlin/lavalink-publishing.gradle.kts | 7 ++++ core/build.gradle.kts | 1 - java/build.gradle.kts | 1 - jda-java/build.gradle.kts | 1 - jda/build.gradle.kts | 1 - kord/build.gradle.kts | 1 - settings.gradle.kts | 1 - 9 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 bom/build.gradle.kts diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts deleted file mode 100644 index 2bcd0387..00000000 --- a/bom/build.gradle.kts +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - `lavalink-publishing` - `java-platform` - `maven-publish` -} - -val me: Project = project - -rootProject.subprojects { - if (name != me.name) { - me.evaluationDependsOn(path) - } -} - -dependencies { - constraints { - rootProject.subprojects.forEach { subproject -> - if (subproject.plugins.hasPlugin("maven-publish") && subproject.name != name) { - subproject.publishing.publications.withType { - if (!artifactId.endsWith("-metadata") && - !artifactId.endsWith("-kotlinMultiplatform") - ) { - api("$groupId:$artifactId:$version") - } - } - } - } - } -} - -publishing { - publications { - create("maven") { - from(components.getByName("javaPlatform")) - } - } -} diff --git a/buildSrc/src/main/kotlin/lavalink-module.gradle.kts b/buildSrc/src/main/kotlin/lavalink-module.gradle.kts index a31eee11..88f40251 100644 --- a/buildSrc/src/main/kotlin/lavalink-module.gradle.kts +++ b/buildSrc/src/main/kotlin/lavalink-module.gradle.kts @@ -1,5 +1,6 @@ plugins { kotlin("multiplatform") + id("org.jetbrains.dokka") `maven-publish` } diff --git a/buildSrc/src/main/kotlin/lavalink-publishing.gradle.kts b/buildSrc/src/main/kotlin/lavalink-publishing.gradle.kts index e8a5b243..75e3455b 100644 --- a/buildSrc/src/main/kotlin/lavalink-publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/lavalink-publishing.gradle.kts @@ -3,6 +3,12 @@ plugins { signing } +val dokkaJar by tasks.registering(Jar::class) { + dependsOn("dokkaHtml") + archiveClassifier.set("javadoc") + from(tasks.getByName("dokkaHtml")) +} + publishing { repositories { listOf( @@ -21,6 +27,7 @@ publishing { publications { withType { + artifact(dokkaJar) pom { name.set(project.name) description.set("Coroutine based client for Lavalink (Kotlin and Java)") diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 8257e0a7..e0abeb2a 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -2,7 +2,6 @@ plugins { `lavalink-module` `lavalink-publishing` kotlin("plugin.serialization") - id("org.jetbrains.dokka") id("kotlinx-atomicfu") } diff --git a/java/build.gradle.kts b/java/build.gradle.kts index d7f079c5..ce2b70b3 100644 --- a/java/build.gradle.kts +++ b/java/build.gradle.kts @@ -1,7 +1,6 @@ plugins { `lavalink-module` `lavalink-publishing` - id("org.jetbrains.dokka") } kotlin { diff --git a/jda-java/build.gradle.kts b/jda-java/build.gradle.kts index bffd319a..98f2be52 100644 --- a/jda-java/build.gradle.kts +++ b/jda-java/build.gradle.kts @@ -1,7 +1,6 @@ plugins { `lavalink-module` `lavalink-publishing` - id("org.jetbrains.dokka") } kotlin { diff --git a/jda/build.gradle.kts b/jda/build.gradle.kts index ee23a5d7..1025c46d 100644 --- a/jda/build.gradle.kts +++ b/jda/build.gradle.kts @@ -1,7 +1,6 @@ plugins { `lavalink-module` `lavalink-publishing` - id("org.jetbrains.dokka") } repositories { diff --git a/kord/build.gradle.kts b/kord/build.gradle.kts index dfcbbc14..8e5a4e18 100644 --- a/kord/build.gradle.kts +++ b/kord/build.gradle.kts @@ -1,7 +1,6 @@ plugins { `lavalink-module` `lavalink-publishing` - id("org.jetbrains.dokka") } kotlin { diff --git a/settings.gradle.kts b/settings.gradle.kts index 305cb618..4d20d326 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,7 +8,6 @@ include("core") include("java") include("jda") include("jda-java") -include("bom") enableFeaturePreview("VERSION_CATALOGS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")