You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.8 KiB

/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
// Configures generation of JavaDoc & Dokka artifacts
def makeLinkMapping(dokka, projectDir) {
dokka.linkMapping {
def relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
dir = "$projectDir/src"
url = "https://github.com/kotlin/kotlinx.coroutines/tree/master/$relPath/src"
suffix = "#L"
}
}
configurations {
dokkaStubs.extendsFrom compileOnly
configureKotlinJvmPlatform(dokkaStubs)
}
apply plugin: 'org.jetbrains.dokka'
tasks.withType(dokka.getClass()) {
jdkVersion = 8
includes = ['README.md']
}
dependencies {
dokkaStubs project(":stdlib-stubs")
}
dokka {
kotlinTasks { [] }
outputFormat = 'kotlin-website'
dependsOn(project.configurations.dokkaStubs)
noStdlibLink = true
externalDocumentationLink {
packageListUrl = rootProject.projectDir.toPath().resolve("site/stdlib.package.list").toUri().toURL()
url = new URL("https://kotlinlang.org/api/latest/jvm/stdlib/")
}
if (project.name != "kotlinx-coroutines-core") {
dependsOn(project.configurations.compileClasspath)
dependsOn(project.sourceSets.main.output)
doFirst {
// resolve classpath only during execution
classpath = project.configurations.dokkaStubs.files + project.configurations.compileClasspath.files + project.sourceSets.main.output.files
}
}
}
if (project.name == "kotlinx-coroutines-core") {
// Custom configuration for MPP modules
dependencies {
dokkaStubs project(":js-stub") // so that JS library reference can resolve properly
dokkaStubs project(":kotlinx-coroutines-core")
}
dokka {
kotlinTasks { [] }
suppressedModifiers = ['actual']
makeLinkMapping(it, projectDir)
makeLinkMapping(it, project.file("js"))
makeLinkMapping(it, project.file("jvm"))
makeLinkMapping(it, project.file("native"))
makeLinkMapping(it, project.file("common"))
// source roots
impliedPlatforms = ['JVM', 'JS', 'Native']
sourceRoot {
path = rootProject.file("$project.name/common/src")
}
sourceRoot {
path = rootProject.file("$project.name/jvm/src")
platforms = ['JVM']
}
sourceRoot {
path = rootProject.file("$project.name/js/src")
platforms = ['JS']
}
sourceRoot {
path = rootProject.file("$project.name/native/src")
platforms = ['Native']
}
doFirst {
classpath = project.configurations.dokkaStubs.files +
project.configurations.jvmCompileClasspath.files +
project.kotlin.targets.jvm.compilations.main.output.allOutputs
}
}
}