1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

Adding projects

This commit is contained in:
Gabryel Monteiro 2020-10-19 00:40:24 -03:00
parent ffa78ebfe1
commit c8a5552c9e

View File

@ -46,24 +46,14 @@ 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 }
} }
tasks.dokkaHtml { tasks.dokkaHtml {
@ -88,15 +78,15 @@ tasks.dokkaHtml {
} }
named("commonMain") { named("commonMain") {
includeSourcesInDokka("commonMain") sourceRoots.setFrom(findSourcesWithName("commonMain"))
} }
named("jsMain") { named("jsMain") {
includeSourcesInDokka("jsMain/*", "commonMain/*") sourceRoots.setFrom(findSourcesWithName("jsMain", "commonMain"))
} }
named("jvmMain") { named("jvmMain") {
includeSourcesInDokka("jvmMain/*", "commonMain/*") sourceRoots.setFrom(findSourcesWithName("jvmMain", "commonMain"))
} }
} }
} }