krontab/dokka.gradle

55 lines
1.6 KiB
Groovy

dokkaHtml {
String dokkaOutputDirectoryPath = null
switch (true) {
case project.hasProperty("DOKKA_PATH"):
dokkaOutputDirectoryPath = project.property("DOKKA_PATH").toString()
break
case System.getenv("DOKKA_PATH") != null:
dokkaOutputDirectoryPath = System.getenv("DOKKA_PATH")
break
}
if (dokkaOutputDirectoryPath != null) {
File outputDirectoryFile = new File(dokkaOutputDirectoryPath)
outputDirectoryFile.mkdirs()
outputDirectory = outputDirectoryFile
}
moduleName.set("kdocs")
dokkaSourceSets {
switch (true) {
case project.hasProperty("DOKKA_PATH"):
outputDirectory = new File(project.property("DOKKA_PATH").toString())
break
case System.getenv("DOKKA_PATH") != null:
outputDirectory = new File(System.getenv("DOKKA_PATH"))
break
}
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
sourceLink {
localDirectory.set(file("./"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/krontab/blob/master/"))
remoteLineSuffix.set("#L")
}
}
named("commonMain") {
sourceRoots.setFrom(findSourcesWithName("commonMain"))
}
//
// named("jsMain") {
// sourceRoot { path = "src/jsMain" }
// }
//
// named("jvmMain") {
// sourceRoot { path = "src/jvmMain" }
// }
}
}
}