build: aggregate Dokka outputs and add module index generation
Enhanced Dokka setup to copy module-specific `html` outputs while generating an `index.html` for easier navigation of aggregated documentation. Updated repository configurations to streamline dependency management. Disabled Kotlin/JS sourcemaps for improved build performance.
This commit is contained in:
+47
-4
@@ -340,14 +340,57 @@ val dokkaAll =
|
|||||||
val dest = layout.buildDirectory.dir("dokka/all").get().asFile
|
val dest = layout.buildDirectory.dir("dokka/all").get().asFile
|
||||||
if (dest.exists()) dest.deleteRecursively()
|
if (dest.exists()) dest.deleteRecursively()
|
||||||
dest.mkdirs()
|
dest.mkdirs()
|
||||||
|
|
||||||
|
val modules = mutableListOf<Pair<String, String>>()
|
||||||
|
|
||||||
subprojects.filter { it.plugins.hasPlugin("org.jetbrains.dokka") }.forEach { p ->
|
subprojects.filter { it.plugins.hasPlugin("org.jetbrains.dokka") }.forEach { p ->
|
||||||
// Dokka V2 writes into build/dokka; copy everything to keep format/plugins agnostic
|
// Dokka V2 writes into build/dokka/html
|
||||||
val out = p.layout.buildDirectory.dir("dokka").get().asFile
|
val outHtml = p.layout.buildDirectory.dir("dokka/html").get().asFile
|
||||||
if (out.exists()) {
|
if (outHtml.exists()) {
|
||||||
out.copyRecursively(File(dest, p.path.trimStart(':').replace(':', '/')), overwrite = true)
|
val modulePath = p.path.trimStart(':').replace(':', '/')
|
||||||
|
val targetDir = File(dest, modulePath)
|
||||||
|
outHtml.copyRecursively(targetDir, overwrite = true)
|
||||||
|
modules.add(p.name to modulePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate a simple index.html to navigate the modules
|
||||||
|
val indexFile = File(dest, "index.html")
|
||||||
|
val links =
|
||||||
|
modules.sortedBy { it.first }.joinToString("\n") { (name, path) ->
|
||||||
|
"""<li><a href="$path/index.html">$name</a> <span style="color:gray; font-size:0.8em">($path)</span></li>"""
|
||||||
|
}
|
||||||
|
|
||||||
|
indexFile.writeText(
|
||||||
|
"""
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Meldestelle Documentation</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 0 auto; padding: 2rem; line-height: 1.5; }
|
||||||
|
h1 { border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
|
||||||
|
ul { list-style-type: none; padding: 0; }
|
||||||
|
li { margin: 0.5rem 0; padding: 0.5rem; background: #f9f9f9; border-radius: 4px; }
|
||||||
|
li:hover { background: #f0f0f0; }
|
||||||
|
a { text-decoration: none; color: #0066cc; font-weight: 500; }
|
||||||
|
a:hover { text-decoration: underline; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Meldestelle Project Documentation</h1>
|
||||||
|
<p>Generated on ${java.time.LocalDateTime.now()}</p>
|
||||||
|
<ul>
|
||||||
|
$links
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""".trimIndent(),
|
||||||
|
)
|
||||||
|
|
||||||
println("[DOKKA] Aggregated Dokka V2 outputs into ${dest.absolutePath}")
|
println("[DOKKA] Aggregated Dokka V2 outputs into ${dest.absolutePath}")
|
||||||
|
println("[DOKKA] Open ${dest.resolve("index.html").absolutePath} in your browser")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ android.nonTransitiveRClass=true
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# Increased Kotlin Daemon Heap for JS Compilation
|
# Increased Kotlin Daemon Heap for JS Compilation
|
||||||
kotlin.daemon.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
|
kotlin.daemon.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
|
||||||
|
kotlin.js.compiler.sourcemaps=false
|
||||||
|
|
||||||
# Kotlin Compiler Optimizations (Phase 5)
|
# Kotlin Compiler Optimizations (Phase 5)
|
||||||
kotlin.incremental=true
|
kotlin.incremental=true
|
||||||
|
|||||||
+7
-5
@@ -8,7 +8,8 @@ pluginManagement {
|
|||||||
google()
|
google()
|
||||||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
||||||
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
|
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
|
||||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||||
|
maven("https://jitpack.io")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,12 +21,13 @@ plugins {
|
|||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
maven { url = uri("https://jitpack.io") }
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
||||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
|
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
|
||||||
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||||
maven { url = uri("https://us-central1-maven.pkg.dev/varabyte-repos/public") }
|
maven("https://jitpack.io")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user