From 041c619f84b3c45990e2627848c4ea034785ca8e Mon Sep 17 00:00:00 2001 From: Stefan Mogeritsch Date: Thu, 5 Feb 2026 12:49:30 +0100 Subject: [PATCH] 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. --- build.gradle.kts | 51 +++++++++++++++++++++++++++++++++++++++++---- gradle.properties | 1 + settings.gradle.kts | 12 ++++++----- 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a596f544..1ff0e0a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -340,14 +340,57 @@ val dokkaAll = val dest = layout.buildDirectory.dir("dokka/all").get().asFile if (dest.exists()) dest.deleteRecursively() dest.mkdirs() + + val modules = mutableListOf>() + subprojects.filter { it.plugins.hasPlugin("org.jetbrains.dokka") }.forEach { p -> - // Dokka V2 writes into build/dokka; copy everything to keep format/plugins agnostic - val out = p.layout.buildDirectory.dir("dokka").get().asFile - if (out.exists()) { - out.copyRecursively(File(dest, p.path.trimStart(':').replace(':', '/')), overwrite = true) + // Dokka V2 writes into build/dokka/html + val outHtml = p.layout.buildDirectory.dir("dokka/html").get().asFile + if (outHtml.exists()) { + 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) -> + """
  • $name ($path)
  • """ + } + + indexFile.writeText( + """ + + + + + Meldestelle Documentation + + + +

    Meldestelle Project Documentation

    +

    Generated on ${java.time.LocalDateTime.now()}

    + + + + """.trimIndent(), + ) + println("[DOKKA] Aggregated Dokka V2 outputs into ${dest.absolutePath}") + println("[DOKKA] Open ${dest.resolve("index.html").absolutePath} in your browser") } } diff --git a/gradle.properties b/gradle.properties index 604a45c3..cbfc73f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,7 @@ android.nonTransitiveRClass=true kotlin.code.style=official # Increased Kotlin Daemon Heap for JS Compilation kotlin.daemon.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g +kotlin.js.compiler.sourcemaps=false # Kotlin Compiler Optimizations (Phase 5) kotlin.incremental=true diff --git a/settings.gradle.kts b/settings.gradle.kts index bafdafe3..82033d8e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,7 +8,8 @@ pluginManagement { google() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") 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 { repositories { + gradlePluginPortal() mavenCentral() google() - maven { url = uri("https://jitpack.io") } - maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } - maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") } - maven { url = uri("https://us-central1-maven.pkg.dev/varabyte-repos/public") } + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + maven("https://us-central1-maven.pkg.dev/varabyte-repos/public") + maven("https://oss.sonatype.org/content/repositories/snapshots/") + maven("https://jitpack.io") } }