/* * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ plugins { kotlin("jvm") version "1.9.0" id("org.jetbrains.dokka") version "1.9.0" `java-library` `maven-publish` } repositories { mavenCentral() } dependencies { testImplementation(kotlin("test-junit")) } val dokkaJavadocJar by tasks.register("dokkaJavadocJar") { dependsOn(tasks.dokkaJavadoc) from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) archiveClassifier.set("javadoc") } val dokkaHtmlJar by tasks.register("dokkaHtmlJar") { dependsOn(tasks.dokkaHtml) from(tasks.dokkaHtml.flatMap { it.outputDirectory }) archiveClassifier.set("html-doc") } publishing { publications { register("library") { from(components["java"]) version = "1.0.0" groupId = "demo" artifactId = "dokka-library-publishing-example" artifact(dokkaJavadocJar) artifact(dokkaHtmlJar) } } }