@@ -36,6 +36,40 @@ java {
3636
3737tasks {
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+
6095val dokkaJar by tasks.creating(Jar ::class ) {
6196 group = JavaBasePlugin .DOCUMENTATION_GROUP
6297 description = " Assembles Kotlin docs with Dokka"
0 commit comments