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

View File

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

View File

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