1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 16:47:13 +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) {
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 }
}
tasks.dokkaHtml {
@ -88,15 +78,15 @@ tasks.dokkaHtml {
}
named("commonMain") {
includeSourcesInDokka("commonMain")
sourceRoots.setFrom(findSourcesWithName("commonMain"))
}
named("jsMain") {
includeSourcesInDokka("jsMain/*", "commonMain/*")
sourceRoots.setFrom(findSourcesWithName("jsMain", "commonMain"))
}
named("jvmMain") {
includeSourcesInDokka("jvmMain/*", "commonMain/*")
sourceRoots.setFrom(findSourcesWithName("jvmMain", "commonMain"))
}
}
}