diff options
-rw-r--r-- | build.gradle.kts | 20 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/org/jetbrains/DokkaPublicationChannel.kt | 3 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/org/jetbrains/publication.kt | 5 |
3 files changed, 24 insertions, 4 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index b8879a31..a1b3a202 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") apply false id("java") + id("org.jetbrains.dokka") version "1.4.10.2" } val dokka_version: String by project @@ -42,6 +43,7 @@ subprojects { apply { plugin("org.jetbrains.kotlin.jvm") plugin("java") + plugin("org.jetbrains.dokka") } // Gradle metadata @@ -50,6 +52,24 @@ subprojects { withSourcesJar() targetCompatibility = JavaVersion.VERSION_1_8 } + + tasks { + val dokkaOutputDir = "$buildDir/dokka" + + dokkaHtml { + outputDirectory.set(file(dokkaOutputDir)) + } + + val deleteDokkaOutputDir by registering(Delete::class) { + delete(dokkaOutputDir) + } + + register<Jar>("javadocJar") { + dependsOn(deleteDokkaOutputDir, dokkaHtml) + archiveClassifier.set("javadoc") + from(dokkaOutputDir) + } + } } // Workaround for https://github.com/bintray/gradle-bintray-plugin/issues/267 diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DokkaPublicationChannel.kt b/buildSrc/src/main/kotlin/org/jetbrains/DokkaPublicationChannel.kt index 059c79ea..42af6e8e 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/DokkaPublicationChannel.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/DokkaPublicationChannel.kt @@ -2,10 +2,7 @@ package org.jetbrains -import org.gradle.api.GradleException import org.gradle.api.Project -import org.gradle.kotlin.dsl.provideDelegate -import org.jetbrains.DokkaPublicationChannel.* internal enum class DokkaPublicationChannel { SpaceDokkaDev, diff --git a/buildSrc/src/main/kotlin/org/jetbrains/publication.kt b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt index 291e3f15..c6b74746 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/publication.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt @@ -6,7 +6,10 @@ import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.tasks.PublishToMavenRepository -import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.register +import org.gradle.kotlin.dsl.withType import org.jetbrains.DokkaPublicationChannel.* import java.net.URI |