krontab/dokka.gradle

55 lines
1.6 KiB
Groovy
Raw Permalink Normal View History

2020-12-05 19:40:29 +00:00
dokkaHtml {
2020-12-07 08:08:59 +00:00
String dokkaOutputDirectoryPath = null
2020-06-03 14:10:06 +00:00
switch (true) {
case project.hasProperty("DOKKA_PATH"):
2020-12-07 08:08:59 +00:00
dokkaOutputDirectoryPath = project.property("DOKKA_PATH").toString()
2020-06-03 14:10:06 +00:00
break
case System.getenv("DOKKA_PATH") != null:
2020-12-07 08:08:59 +00:00
dokkaOutputDirectoryPath = System.getenv("DOKKA_PATH")
2020-06-03 14:10:06 +00:00
break
}
2020-12-07 08:08:59 +00:00
if (dokkaOutputDirectoryPath != null) {
File outputDirectoryFile = new File(dokkaOutputDirectoryPath)
outputDirectoryFile.mkdirs()
outputDirectory = outputDirectoryFile
}
2020-06-03 14:10:06 +00:00
2020-12-07 08:24:41 +00:00
moduleName.set("kdocs")
2021-08-07 10:10:59 +00:00
2020-12-05 19:40:29 +00:00
dokkaSourceSets {
2021-08-07 10:10:59 +00:00
switch (true) {
case project.hasProperty("DOKKA_PATH"):
2021-08-07 10:25:35 +00:00
outputDirectory = new File(project.property("DOKKA_PATH").toString())
2021-08-07 10:10:59 +00:00
break
case System.getenv("DOKKA_PATH") != null:
2021-08-07 10:25:35 +00:00
outputDirectory = new File(System.getenv("DOKKA_PATH"))
2021-08-07 10:10:59 +00:00
break
}
2020-06-03 14:10:06 +00:00
2021-08-07 10:10:59 +00:00
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
sourceLink {
localDirectory.set(file("./"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/krontab/blob/master/"))
remoteLineSuffix.set("#L")
}
2020-06-03 14:10:06 +00:00
}
2021-08-07 10:10:59 +00:00
named("commonMain") {
sourceRoots.setFrom(findSourcesWithName("commonMain"))
}
2020-12-05 19:40:29 +00:00
//
2021-08-07 10:10:59 +00:00
// named("jsMain") {
// sourceRoot { path = "src/jsMain" }
// }
2020-12-05 19:40:29 +00:00
//
2021-08-07 10:10:59 +00:00
// named("jvmMain") {
// sourceRoot { path = "src/jvmMain" }
// }
}
2020-06-03 14:10:06 +00:00
}
}