Skip to content

Commit

Permalink
fix: 更新dokka到 1.9.0 并修复与 kapt 冲突的问题([#3153](Kotlin/dokka#3153))
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Sep 25, 2023
1 parent a9725fb commit 8b14b21
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 36 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Expand Up @@ -22,7 +22,7 @@ repositories {
}

val kotlinVersion = "1.9.10"
val dokkaPluginVersion = "1.8.20"
val dokkaPluginVersion = "1.9.0"
val suspendTransformVersion = "0.5.0"
val gradleCommon = "0.1.1"
val ktor = "2.3.1"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/changelog/GenerateChangelog.kt
Expand Up @@ -135,7 +135,7 @@ fun Project.generateChangelog(tag: String) {
}
}

val tmpDir = rootProject.buildDir.resolve("tmp/changelog").apply { mkdirs() }
val tmpDir = rootProject.layout.buildDirectory.dir("tmp/changelog").get().asFile.apply { mkdirs() }

val tmpFile =
Files.createTempFile(tmpDir.toPath(), "changelog", "tmp").toFile()
Expand Down
Expand Up @@ -13,26 +13,18 @@
import org.jetbrains.dokka.DokkaConfiguration
import java.net.URL

/*
* Copyright (c) 2022-2022 ForteScarlet <ForteScarlet@163.com>
*
* 本文件是 simply-robot (或称 simple-robot 3.x 、simbot 3.x ) 的一部分。
*
* simply-robot 是自由软件:你可以再分发之和/或依照由自由软件基金会发布的 GNU 通用公共许可证修改之,无论是版本 3 许可证,还是(按你的决定)任何以后版都可以。
*
* 发布 simply-robot 是希望它能有用,但是并无保障;甚至连可销售和符合某个特定的目的都不保证。请参看 GNU 通用公共许可证,了解详情。
*
* 你应该随程序获得一份 GNU 通用公共许可证的复本。如果没有,请看:
* https://www.gnu.org/licenses
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
* https://www.gnu.org/licenses/lgpl-3.0-standalone.html
*
*/


plugins {
id("org.jetbrains.dokka")
}

tasks.named("dokkaHtml").configure {
tasks.findByName("kaptKotlin")?.also { kaptKotlinTask ->
dependsOn(kaptKotlinTask)
}
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
version = P.Simbot.versionWithoutSnapshot
Expand Down
16 changes: 0 additions & 16 deletions buildSrc/src/main/kotlin/simbot.dokka-multi-module.gradle.kts
Expand Up @@ -14,22 +14,6 @@ import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import java.time.Year

/*
* Copyright (c) 2022-2022 ForteScarlet <ForteScarlet@163.com>
*
* 本文件是 simply-robot (即 simple robot的v3版本,因此亦可称为 simple-robot v3 、simbot v3 等) 的一部分。
*
* simply-robot 是自由软件:你可以再分发之和/或依照由自由软件基金会发布的 GNU 通用公共许可证修改之,无论是版本 3 许可证,还是(按你的决定)任何以后版都可以。
*
* 发布 simply-robot 是希望它能有用,但是并无保障;甚至连可销售和符合某个特定的目的都不保证。请参看 GNU 通用公共许可证,了解详情。
*
* 你应该随程序获得一份 GNU 通用公共许可证的复本。如果没有,请看:
* https://www.gnu.org/licenses
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
* https://www.gnu.org/licenses/lgpl-3.0-standalone.html
*
*
*/

/*
使用在根配置,配置dokka多模块
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Expand Up @@ -5,7 +5,10 @@ kotlin.native.ignoreDisabledTargets=true
#kotlin.daemon.jvmargs=-Xmx2g -Dfile.encoding=UTF-8

# see https://github.com/Kotlin/dokka/issues/3153
org.jetbrains.dokka.classpath.useNativeDistributionAccessor=true
#org.jetbrains.dokka.classpath.useNativeDistributionAccessor=true
#org.jetbrains.dokka.classpath.useKonanDistribution=true
#org.jetbrains.dokka.classpath.excludePlatformDependencyFiles=true


#org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx8G -Xms2G -XX:MaxMetaspaceSize=1G -Dfile.encoding=UTF-8
Expand Down
3 changes: 1 addition & 2 deletions simbot-api/src/main/kotlin/love/forte/simbot/ID.kt
Expand Up @@ -487,7 +487,7 @@ public sealed class NumericalID<N : Number> : ID(), NumberSimilarly {
* 将当前数字转为 [Char]. 同 [Number.toChar].
* @see Number.toChar
*/
override fun toChar(): Char = value.toChar()
override fun toChar(): Char = value.toInt().toChar()

/**
* 将当前数字转为 [Short]. 同 [Number.toShort].
Expand Down Expand Up @@ -1084,7 +1084,6 @@ private class NumericalIdNumber(private val id: NumericalID<*>) : Number() {
override fun toShort(): Short = id.toShort()
override fun toInt(): Int = id.toInt()
override fun toLong(): Long = id.toLong()
override fun toChar(): Char = id.toChar()
override fun toDouble(): Double = id.toDouble()
override fun toFloat(): Float = id.toFloat()
}
Expand Down

0 comments on commit 8b14b21

Please sign in to comment.