Skip to content

Commit 5c3d611

Browse files
committed
build: Update Dokka to 2.0.0
1 parent 2101252 commit 5c3d611

File tree

3 files changed

+43
-55
lines changed

3 files changed

+43
-55
lines changed

build.gradle.kts

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,31 +154,33 @@ apiValidation {
154154

155155
// region Dokka
156156

157-
childProjects.values.forEach { childProject ->
158-
childProject.afterEvaluate {
159-
if (childProject.plugins.hasPlugin(libs.plugins.dokka.get().pluginId)) {
160-
dokka {
161-
configSourceSets(childProject)
162-
configHtmlCustoms(childProject)
163-
}
164-
rootProject.dependencies.dokka(childProject)
165-
}
166-
}
167-
}
168-
169-
// subprojects {
170-
// afterEvaluate {
171-
// val p = this
172-
// if (plugins.hasPlugin(libs.plugins.dokka.get().pluginId)) {
157+
// childProjects.values.forEach { childProject ->
158+
// childProject.afterEvaluate {
159+
// if (childProject.plugins.hasPlugin(libs.plugins.dokka.get().pluginId)) {
173160
// dokka {
174-
// configSourceSets(p)
175-
// configHtmlCustoms(p)
161+
// configSourceSets(childProject)
162+
// configHtmlCustoms(childProject)
176163
// }
177-
// rootProject.dependencies.dokka(p)
164+
// rootProject.dependencies.dokka(childProject)
178165
// }
179166
// }
180167
// }
181168

169+
subprojects {
170+
afterEvaluate {
171+
val p = this
172+
if (plugins.hasPlugin(libs.plugins.dokka.get().pluginId)) {
173+
dokka {
174+
configSourceSets(p)
175+
pluginsConfiguration.html {
176+
configHtmlCustoms(project)
177+
}
178+
}
179+
rootProject.dependencies.dokka(p)
180+
}
181+
}
182+
}
183+
182184
dokka {
183185
moduleName = "Simple Robot 组件 | OneBot"
184186

@@ -191,6 +193,9 @@ dokka {
191193

192194
configSourceSets(project)
193195

194-
configHtmlCustoms(project)
196+
pluginsConfiguration.html {
197+
configHtmlCustoms(project)
198+
}
195199
}
196200
// endregion
201+

buildSrc/src/main/kotlin/DokkaConfigs.kt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import gradle.kotlin.dsl.accessors._f907feec8c76a07e07390d77a722d2df.html
21
import org.gradle.api.Project
32
import org.gradle.api.tasks.compile.JavaCompile
43
import org.jetbrains.dokka.gradle.DokkaExtension
54
import org.jetbrains.dokka.gradle.engine.parameters.DokkaSourceSetSpec
65
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
6+
import org.jetbrains.dokka.gradle.engine.plugins.DokkaHtmlPluginParameters
77
import java.io.File
88
import java.net.URI
99
import java.time.Year
@@ -104,27 +104,25 @@ fun DokkaSourceSetSpec.configExternalDocumentations() {
104104
)
105105
}
106106

107-
fun DokkaExtension.configHtmlCustoms(project: Project) {
108-
pluginsConfiguration.html {
109-
customAssets.from(
110-
project.rootProject.file(".simbot/dokka-assets/logo-icon.svg"),
111-
project.rootProject.file(".simbot/dokka-assets/logo-icon-light.svg"),
112-
)
107+
fun DokkaHtmlPluginParameters.configHtmlCustoms(project: Project) {
108+
customAssets.from(
109+
project.rootProject.file(".simbot/dokka-assets/logo-icon.svg"),
110+
project.rootProject.file(".simbot/dokka-assets/logo-icon-light.svg"),
111+
)
113112

114-
customStyleSheets.from(project.rootProject.file(".simbot/dokka-assets/css/kdoc-style.css"))
113+
customStyleSheets.from(project.rootProject.file(".simbot/dokka-assets/css/kdoc-style.css"))
115114

116-
if (!isSimbotLocal()) {
117-
templatesDir.set(project.rootProject.file(".simbot/dokka-templates"))
118-
}
115+
if (!isSimbotLocal()) {
116+
templatesDir.set(project.rootProject.file(".simbot/dokka-templates"))
117+
}
119118

120-
val now = Year.now().value
121-
footerMessage.set(
122-
"© 2024-$now " +
123-
"<a href='https://github.com/simple-robot'>Simple Robot</a>. All rights reserved."
124-
)
119+
val now = Year.now().value
120+
footerMessage.set(
121+
"© 2024-$now " +
122+
"<a href='https://github.com/simple-robot'>Simple Robot</a>. All rights reserved."
123+
)
125124

126-
separateInheritedMembers.set(true)
127-
mergeImplicitExpectActualDeclarations.set(true)
128-
homepageLink.set(P.ComponentOneBot.HOMEPAGE)
129-
}
125+
separateInheritedMembers.set(true)
126+
mergeImplicitExpectActualDeclarations.set(true)
127+
homepageLink.set(P.ComponentOneBot.HOMEPAGE)
130128
}

simbot-component-onebot-v11/build.gradle.kts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)