Skip to content

Commit

Permalink
Fix dokka
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Jan 12, 2021
1 parent fe151a9 commit 7d3bcbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
44 changes: 21 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 Mamoe Technologies and contributors.
* Copyright 2019-2021 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
Expand Down Expand Up @@ -38,7 +38,7 @@ buildscript {
plugins {
kotlin("jvm") version Versions.kotlinCompiler
kotlin("plugin.serialization") version Versions.kotlinCompiler
id("org.jetbrains.dokka") version Versions.dokka apply false
id("org.jetbrains.dokka") version Versions.dokka
id("net.mamoe.kotlin-jvm-blocking-bridge") version Versions.blockingBridge apply false
id("com.jfrog.bintray") version Versions.bintray
}
Expand Down Expand Up @@ -94,8 +94,12 @@ allprojects {
if (isKotlinJvmProject) {
configureFlattenSourceSets()
}
}
}

configureDokka()
subprojects {
afterEvaluate {
if (project.name == "mirai-core-api") configureDokka()
}
}

Expand All @@ -108,34 +112,28 @@ fun Project.useIr() {
fun Project.configureDokka() {
apply(plugin = "org.jetbrains.dokka")
tasks {
val dokka by getting(DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$buildDir/dokka"
val dokkaHtml by getting(DokkaTask::class) {
outputDirectory.set(buildDir.resolve("dokka"))
}
val dokkaMarkdown by creating(DokkaTask::class) {
outputFormat = "markdown"
outputDirectory = "$buildDir/dokka-markdown"
}
val dokkaGfm by creating(DokkaTask::class) {
outputFormat = "gfm"
outputDirectory = "$buildDir/dokka-gfm"
val dokkaGfm by getting(DokkaTask::class) {
outputDirectory.set(buildDir.resolve("dokka-gfm"))
}
}
for (task in tasks.filterIsInstance<DokkaTask>()) {
task.configuration {
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
perPackageOption {
prefix = "net.mamoe.mirai"
skipDeprecated = true
matchingRegex.set("net\\.mamoe\\.mirai\\.*")
skipDeprecated.set(true)
}

for (suppressedPackage in arrayOf(
"net.mamoe.mirai.internal",
"net.mamoe.mirai.event.internal",
"net.mamoe.mirai.utils.internal",
"net.mamoe.mirai.internal"
"""net.mamoe.mirai.internal""",
"""net.mamoe.mirai.internal.message""",
"""net.mamoe.mirai.internal.network"""
)) {
perPackageOption {
prefix = suppressedPackage
suppress = true
matchingRegex.set(suppressedPackage.replace(".", "\\."))
suppress.set(true)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ object Versions {

const val kotlinCompiler = "1.4.21"
const val kotlinStdlib = "1.4.21"
const val dokka = "1.4.20"

const val coroutines = "1.4.1"
const val atomicFU = "0.14.4"
const val serialization = "1.0.1"
Expand All @@ -25,7 +27,6 @@ object Versions {

const val io = "0.1.16"
const val coroutinesIo = "0.1.16"
const val dokka = "0.10.1"

const val blockingBridge = "1.5.0"

Expand Down

0 comments on commit 7d3bcbe

Please sign in to comment.