Skip to content

Commit

Permalink
Upgrade to dokka 1.4.0 and fix docs task
Browse files Browse the repository at this point in the history
  • Loading branch information
BartArys committed Sep 15, 2020
1 parent 128abe0 commit c83a7b4
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.BintrayPlugin
import japicmp.filter.ClassFilter
import javassist.CtClass

import org.ajoberstar.gradle.git.publish.GitPublishExtension
import org.ajoberstar.gradle.git.publish.tasks.GitPublishPush
import org.ajoberstar.gradle.git.publish.tasks.GitPublishReset

buildscript {
repositories {
Expand All @@ -24,7 +21,7 @@ buildscript {

plugins {
id("org.jetbrains.kotlin.jvm") version Versions.kotlin
id("org.jetbrains.dokka") version "1.4.0-rc"
id("org.jetbrains.dokka") version "1.4.0"
id("org.ajoberstar.git-publish") version "2.1.3"
id("me.champeau.gradle.japicmp")
}
Expand Down Expand Up @@ -93,21 +90,20 @@ subprojects {


tasks.dokkaHtml.configure {
outputDirectory = "${rootProject.projectDir}/dokka/kord/"
this.outputDirectory.set(file("${project.projectDir}/dokka/kord/"))

dokkaSourceSets {
configureEach {
platform = org.jetbrains.dokka.Platform.jvm.name
platform.set(org.jetbrains.dokka.Platform.jvm)

//doesn't work for whatever reason
sourceLink {
val relativePath = project.projectDir.relativeTo(project.rootProject.projectDir).path
path = "$relativePath/src/main/kotlin"
url = "https://github.com/kordlib/kord/blob/master/${project.name}/src/main/kotlin"
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(uri("https://github.com/kordlib/kord/tree/master/${project.name}/src/main/kotlin/").toURL())

lineSuffix = "#L"
remoteLineSuffix.set("#L")
}

jdkVersion = 8
jdkVersion.set(8)
}
}
}
Expand Down Expand Up @@ -165,18 +161,18 @@ tasks {
delete(dokkaOutputDir)
}

dokkaHtmlMultimodule.configure {
dokkaHtmlMultiModule.configure {
dependsOn(clean)
outputDirectory = dokkaOutputDir
documentationFileName = "DokkaDescription.md"
outputDirectory.set(file(dokkaOutputDir))
documentationFileName.set("DokkaDescription.md")
}


val fixIndex by register<DocsTask>("fixIndex") {
dependsOn(dokkaHtmlMultimodule)
}

val gitPublishPush by getting(GitPublishPush::class) {
val gitPublishReset by getting(GitPublishReset::class) {
dependsOn(fixIndex)
}

Expand All @@ -187,7 +183,7 @@ configure<GitPublishExtension> {
branch.set("gh-pages")

contents {
from("dokka")
from(file("${project.projectDir}/dokka"))
}

commitMessage.set("Update Docs")
Expand Down

0 comments on commit c83a7b4

Please sign in to comment.