Skip to content

Commit

Permalink
Work around Kotlin/dokka#3965
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdgr8 committed Dec 28, 2024
1 parent 33897be commit 0304154
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ tasks.dokkaGeneratePublicationHtml {
doLast {
apiDocsDir.deleteRecursively()
outputDirectory.get().asFile.renameTo(apiDocsDir)

// work around https://github.com/Kotlin/dokka/issues/3965
fun removeExtraNewlines(dir: File) {
dir.listFiles()?.forEach { file ->
if (file.isDirectory) {
removeExtraNewlines(file)
} else if (file.extension == "html") {
val contents = file.readText().dropLast(1)
file.writeText(contents)
}
}
}
removeExtraNewlines(olderDir)
}
}

Expand Down

0 comments on commit 0304154

Please sign in to comment.