Skip to content

Commit ab85787

Browse files
committed
playing with dokka
1 parent 1b04751 commit ab85787

File tree

7 files changed

+42
-160
lines changed

7 files changed

+42
-160
lines changed

.idea/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.idea/GrepConsole.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.idea/gradle.xml

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlin-unsigned.iml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.idea/uiDesigner.xml

Lines changed: 0 additions & 124 deletions
This file was deleted.

build.gradle.kts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,40 @@ java {
3636

3737
tasks {
3838

39+
val moveCss by registering {
40+
description = "Move style.css in kotlin-unsigned folder (distribution friendly)."
41+
// fun File.fixStyle() = readText().replace("../style.css", "style.css").also { writeText(it) }
42+
// fun File.recursivelyFixStyle() {
43+
// list()?.map(::resolve)?.forEach { if (it.isDirectory) it.recursivelyFixStyle() else it.fixStyle() }
44+
// }
45+
doLast {
46+
val output = file(dokkaHtml.get().outputDirectory)
47+
// val folder = output.resolve("kotlin-unsigned").apply { recursivelyFixStyle() }
48+
// output.resolve("style.css").apply { renameTo(folder.resolve(name)) }
49+
val target = "$output/kotlin-unsigned"
50+
ant.withGroovyBuilder {
51+
// "move"( "styles" to target)
52+
}
53+
}
54+
}
55+
56+
dokkaHtml {
57+
dokkaSourceSets {
58+
configureEach {
59+
sourceLink {
60+
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
61+
// path = "src/main/kotlin"
62+
63+
// URL showing where the source code can be accessed through the web browser
64+
url = "https://github.com/kotlin-graphics/kotlin-unsigned/tree/master/src/main/kotlin"
65+
// Suffix which is used to append the line number to the URL. Use #L for GitHub
66+
lineSuffix = "#L"
67+
}
68+
}
69+
}
70+
finalizedBy(moveCss)
71+
}
72+
3973
compileKotlin {
4074
kotlinOptions {
4175
jvmTarget = "11"
@@ -57,6 +91,7 @@ tasks {
5791
withType<Test> { useJUnitPlatform() }
5892
}
5993

94+
6095
val dokkaJar by tasks.creating(Jar::class) {
6196
group = JavaBasePlugin.DOCUMENTATION_GROUP
6297
description = "Assembles Kotlin docs with Dokka"

0 commit comments

Comments
 (0)