Skip to content

Commit

Permalink
configure dokka
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlauvlwj committed Jul 22, 2024
1 parent 6c19c50 commit 912d849
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 64 deletions.
52 changes: 0 additions & 52 deletions PACKAGES.md

This file was deleted.

38 changes: 27 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@
group = "org.ktorm"
version = file("ktorm.version").readLines()[0]

task("printClasspath") {
doLast {
val jars = subprojects
.map { it.configurations["compileClasspath"] }
.flatMap { it.files }
.filterNotTo(HashSet()) { it.name.contains("ktorm") }
.onEach { println(it.name) }
plugins {
id("org.jetbrains.dokka") version "1.9.20"
}

repositories {
mavenCentral()
gradlePluginPortal()
}

tasks.dokkaHtmlMultiModule {
val templatesDir = System.getenv("DOKKA_TEMPLATES_DIR")
if (!templatesDir.isNullOrEmpty()) {
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.base.DokkaBase" to """{"templatesDir": "$templatesDir"}"""))
}
}

subprojects {
apply(plugin = "org.jetbrains.dokka")

val file = file("build/ktorm.classpath")
file.parentFile.mkdirs()
file.writeText(jars.joinToString(File.pathSeparator) { it.absolutePath })
println("Classpath written to build/ktorm.classpath")
tasks.named<org.jetbrains.dokka.gradle.DokkaTaskPartial>("dokkaHtmlPartial") {
dokkaSourceSets.named("main") {
suppressGeneratedFiles.set(false)
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(java.net.URL("https://github.com/kotlin-orm/ktorm/blob/master/${project.name}/src/main/kotlin"))
remoteLineSuffix.set("#L")
}
}
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id("com.gradle.enterprise") version("3.14.1")
id("com.gradle.enterprise") version "3.14.1"
}

include("ktorm-core")
Expand Down

0 comments on commit 912d849

Please sign in to comment.