Update Dokka to 1.4.0-rc

The output is significantly nicer.

External documentation links don't seem to work correctly at the moment,
so I have commented those out for now.

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 4 years ago
parent d8f98c1bf5
commit 8cbf973f50
  1. 184
      build.gradle.kts
  2. 2
      buildSrc/src/main/java/Versions.kt
  3. 2
      gradle.properties

@ -1,9 +1,9 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jmailen.gradle.kotlinter.KotlinterExtension import org.jmailen.gradle.kotlinter.KotlinterExtension
import org.jmailen.gradle.kotlinter.KotlinterPlugin import org.jmailen.gradle.kotlinter.KotlinterPlugin
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.net.URL
defaultTasks("build") defaultTasks("build")
@ -28,6 +28,7 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
maven(url = "https://repo.openrs2.dev/repository/openrs2") maven(url = "https://repo.openrs2.dev/repository/openrs2")
mavenLocal() mavenLocal()
maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots")
@ -113,6 +114,7 @@ configure(subprojects.filter { it.isFree }) {
apply(plugin = "jacoco") apply(plugin = "jacoco")
plugins.withType<KotlinPluginWrapper> { plugins.withType<KotlinPluginWrapper> {
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "org.jmailen.kotlinter") apply(plugin = "org.jmailen.kotlinter")
dependencies { dependencies {
@ -130,6 +132,92 @@ configure(subprojects.filter { it.isFree }) {
} }
} }
tasks.withType<DokkaTask> {
inputs.dir("$rootDir/.git")
dokkaSourceSets {
configureEach {
includeNonPublic = true
jdkVersion = 11
moduleDisplayName = "openrs2"
sourceLink {
path = rootDir.toString()
url = "https://git.openrs2.dev/openrs2/openrs2/src/commit/${commitHash()}"
lineSuffix = "#L"
}
/*externalDocumentationLink {
url = URL("https://asm.ow2.io/javadoc/")
}
externalDocumentationLink {
url = URL("https://www.bouncycastle.org/docs/docs1.5on/")
}
externalDocumentationLink {
url = URL("https://www.bouncycastle.org/docs/pkixdocs1.5on/")
}
externalDocumentationLink {
url = URL("https://ajalt.github.io/clikt/api/clikt/")
}
externalDocumentationLink {
url = URL("https://commons.apache.org/proper/commons-compress/javadocs/api-${Versions.commonsCompress}/")
}
externalDocumentationLink {
url = URL("https://guava.dev/releases/${Versions.guava}/api/docs/")
}
externalDocumentationLink {
url = URL("https://google.github.io/guice/api-docs/${Versions.guice}/javadoc/")
}
val jacksonVersion = Versions.jackson.split(".")
.take(2)
.joinToString(".")
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-annotations/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-core/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-databind/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-dataformats-text/javadoc/yaml/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("http://www.jdom.org/docs/apidocs/")
}
externalDocumentationLink {
url = URL("https://google.github.io/jimfs/releases/${Versions.jimfs}/api/docs/")
}
externalDocumentationLink {
url = URL("https://junit.org/junit5/docs/${Versions.junit}/api/")
}
externalDocumentationLink {
val version = Versions.netty.split(".")
.take(2)
.joinToString(".")
url = URL("https://netty.io/$version/api/")
}*/
}
}
}
plugins.withType<JavaPlugin> { plugins.withType<JavaPlugin> {
dependencies { dependencies {
val testRuntimeOnly by configurations val testRuntimeOnly by configurations
@ -225,100 +313,6 @@ fun commitHash(): String {
return String(out.toByteArray(), Charsets.UTF_8).trim() return String(out.toByteArray(), Charsets.UTF_8).trim()
} }
tasks.dokka {
inputs.dir("$rootDir/.git")
outputDirectory = "$buildDir/kdoc"
outputFormat = "html"
subProjects = subprojects.filter { it.isFree && it.name != "deob-annotations" }.map { it.name }
configuration {
includeNonPublic = true
/*
* XXX(gpe): ideally we'd use 11 here, but we're blocked on
* https://github.com/Kotlin/dokka/issues/294. 9 is the most recent
* working version for now.
*/
jdkVersion = 9
sourceLink {
path = "."
url = "https://git.openrs2.dev/openrs2/openrs2/src/commit/${commitHash()}"
lineSuffix = "#L"
}
externalDocumentationLink {
url = URL("https://asm.ow2.io/javadoc/")
}
externalDocumentationLink {
url = URL("https://www.bouncycastle.org/docs/docs1.5on/")
}
externalDocumentationLink {
url = URL("https://www.bouncycastle.org/docs/pkixdocs1.5on/")
}
externalDocumentationLink {
url = URL("https://ajalt.github.io/clikt/api/clikt/")
}
externalDocumentationLink {
url = URL("https://commons.apache.org/proper/commons-compress/javadocs/api-${Versions.commonsCompress}/")
}
externalDocumentationLink {
url = URL("https://guava.dev/releases/${Versions.guava}/api/docs/")
}
externalDocumentationLink {
url = URL("https://google.github.io/guice/api-docs/${Versions.guice}/javadoc/")
}
val jacksonVersion = Versions.jackson.split(".")
.take(2)
.joinToString(".")
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-annotations/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-core/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-databind/javadoc/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("https://fasterxml.github.io/jackson-dataformats-text/javadoc/yaml/$jacksonVersion/")
}
externalDocumentationLink {
url = URL("http://www.jdom.org/docs/apidocs/")
}
externalDocumentationLink {
url = URL("https://google.github.io/jimfs/releases/${Versions.jimfs}/api/docs/")
}
externalDocumentationLink {
url = URL("https://junit.org/junit5/docs/${Versions.junit}/api/")
}
externalDocumentationLink {
val version = Versions.netty.split(".")
.take(2)
.joinToString(".")
url = URL("https://netty.io/$version/api/")
}
}
}
tasks.wrapper { tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL distributionType = Wrapper.DistributionType.ALL
} }

@ -5,7 +5,7 @@ object Versions {
const val clikt = "2.8.0" const val clikt = "2.8.0"
const val commonsCompress = "1.20" const val commonsCompress = "1.20"
const val dependencyLicenseReport = "1.14" const val dependencyLicenseReport = "1.14"
const val dokka = "0.10.1" const val dokka = "1.4.0-rc"
const val fastutil = "8.4.1" const val fastutil = "8.4.1"
const val fernflower = "1.0.4-SNAPSHOT" const val fernflower = "1.0.4-SNAPSHOT"
const val guava = "29.0-jre" const val guava = "29.0-jre"

@ -1 +1,3 @@
kotlin.code.style=official kotlin.code.style=official
# see https://github.com/Kotlin/dokka/issues/1405
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m

Loading…
Cancel
Save