Merge pull request #154 from Megamiun/gm/update-dokka

Gm/update dokka
This commit is contained in:
InsanusMokrassar 2020-10-22 19:18:51 +06:00 committed by GitHub
commit eb97a8e151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 31 deletions

View File

@ -46,29 +46,17 @@ kotlin {
} }
} }
private Closure includeSourcesInDokka(String... approximateNames) { private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
return { return parent.subprojects
parent.subprojects.forEach { .findAll { it != project }
if (it != project) { .collectMany { it.kotlin.sourceSets }
File srcDir = new File(it.projectDir.absolutePath, "src") .findAll { sourceSet -> approximateNames.any {
if (srcDir.exists() && srcDir.isDirectory()) { nameToFilter -> sourceSet.name.contains(nameToFilter)
srcDir.eachFile { file ->
if (approximateNames.any { file.name.contains(it) } && file.isDirectory()) {
String pathToSrc = file.absolutePath
sourceRoot {
path = pathToSrc
}
}
}
}
} }
} }.collect { it.kotlin }
}
} }
dokka { tasks.dokkaHtml {
outputFormat = 'html'
switch (true) { switch (true) {
case project.hasProperty("DOKKA_PATH"): case project.hasProperty("DOKKA_PATH"):
outputDirectory = project.property("DOKKA_PATH").toString() outputDirectory = project.property("DOKKA_PATH").toString()
@ -78,19 +66,27 @@ dokka {
break break
} }
multiplatform { dokkaSourceSets {
global { configureEach {
skipDeprecated = true skipDeprecated.set(true)
sourceLink { sourceLink {
path = "./" localDirectory.set(file("./"))
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/" remoteUrl.set(new URL("https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"))
lineSuffix = "#L" remoteLineSuffix.set("#L")
} }
} }
common(includeSourcesInDokka("commonMain")) named("commonMain") {
js(includeSourcesInDokka("jsMain"/*, "commonMain"*/)) sourceRoots.setFrom(findSourcesWithName("commonMain"))
jvm(includeSourcesInDokka("jvmMain"/*, "commonMain"*/)) }
named("jsMain") {
sourceRoots.setFrom(findSourcesWithName("jsMain", "commonMain"))
}
named("jvmMain") {
sourceRoots.setFrom(findSourcesWithName("jvmMain", "commonMain"))
}
} }
} }

View File

@ -1,3 +1,3 @@
dokka_version=0.10.1 dokka_version=1.4.0
org.gradle.jvmargs=-Xmx1024m org.gradle.jvmargs=-Xmx1024m

View File

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1024m org.gradle.jvmargs=-Xmx2048m
kotlin.code.style=official kotlin.code.style=official
org.gradle.parallel=true org.gradle.parallel=true
kotlin.js.generate.externals=true kotlin.js.generate.externals=true

View File

@ -1,3 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
}
}
include ":tgbotapi.core" include ":tgbotapi.core"
include ":tgbotapi.extensions.api" include ":tgbotapi.extensions.api"
include ":tgbotapi.extensions.utils" include ":tgbotapi.extensions.utils"