Skip to content

Commit

Permalink
improve(build): dokka config
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Feb 24, 2025
1 parent 6cd1a7c commit b46e345
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import changelog.GenerateChangelogTask
import changelog.GenerateSubChangelogTask
import love.forte.plugin.suspendtrans.*
import love.forte.plugin.suspendtrans.gradle.SuspendTransformGradleExtension
import org.jetbrains.dokka.gradle.DokkaExtension
import org.jetbrains.dokka.gradle.engine.parameters.DokkaSourceSetSpec
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
import java.net.URI
Expand Down Expand Up @@ -406,6 +407,7 @@ subprojects {
configSourceLink(p)
configExternalDocumentations()
}
configHtmlCustom()
}
rootProject.dependencies.dokka(p)
}
Expand Down Expand Up @@ -479,6 +481,30 @@ fun DokkaSourceSetSpec.configExternalDocumentations() {
)
}

fun DokkaExtension.configHtmlCustom() {
pluginsConfiguration.html {
customAssets.from(
rootProject.file(".simbot/dokka-assets/logo-icon.svg"),
rootProject.file(".simbot/dokka-assets/logo-icon-light.svg"),
)

customStyleSheets.from(rootProject.file(".simbot/dokka-assets/css/kdoc-style.css"))

if (!isSimbotLocal()) {
templatesDir = rootProject.file(".simbot/dokka-templates")
}

footerMessage =
"© 2021-${Year.now().value} " +
"<a href='https://github.com/simple-robot'>Simple Robot</a>. " +
"All rights reserved."

separateInheritedMembers = true
mergeImplicitExpectActualDeclarations = true
homepageLink = P.HOMEPAGE
}
}

dokka {
moduleName = "Simple Robot"

Expand Down Expand Up @@ -515,25 +541,6 @@ dokka {
configExternalDocumentations()
}

pluginsConfiguration.html {
customAssets.from(
rootProject.file(".simbot/dokka-assets/logo-icon.svg"),
rootProject.file(".simbot/dokka-assets/logo-icon-light.svg"),
)

customStyleSheets.from(rootProject.file(".simbot/dokka-assets/css/kdoc-style.css"))

if (!isSimbotLocal()) {
templatesDir = rootProject.file(".simbot/dokka-templates")
}

footerMessage =
"© 2021-${Year.now().value} <a href='https://github.com/simple-robot'>Simple Robot</a>. " +
"All rights reserved."

separateInheritedMembers = true
mergeImplicitExpectActualDeclarations = true
homepageLink = P.HOMEPAGE
}
configHtmlCustom()
}
// endregion

0 comments on commit b46e345

Please sign in to comment.