1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-18 06:13:47 +00:00
tgbotapi/docs/build.gradle

79 lines
2.2 KiB
Groovy
Raw Normal View History

2020-05-10 19:09:07 +00:00
plugins {
2020-08-18 06:50:11 +00:00
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "org.jetbrains.dokka"
2020-05-10 19:09:07 +00:00
}
project.description = "Full collection of all built-in tgbotapi tools"
2020-05-10 19:09:07 +00:00
apply from: "$mppProjectWithSerializationPresetPath"
2020-05-10 19:09:07 +00:00
kotlin {
2020-05-10 19:09:07 +00:00
sourceSets {
commonMain {
dependencies {
2022-04-18 11:34:34 +00:00
api project(":tgbotapi.core")
api project(":tgbotapi.api")
api project(":tgbotapi.utils")
api project(":tgbotapi.behaviour_builder")
api project(":tgbotapi.behaviour_builder.fsm")
api project(":tgbotapi")
}
}
jsMain {
dependencies {
api project(":tgbotapi.webapps")
2020-05-10 19:09:07 +00:00
}
}
}
}
2020-10-19 03:40:24 +00:00
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
return parent.subprojects
2022-08-05 16:03:10 +00:00
.findAll { it != project && it.hasProperty("kotlin") }
.collectMany { it.kotlin.sourceSets }
.findAll { sourceSet ->
approximateNames.any { nameToFilter ->
sourceSet.name.contains(nameToFilter)
}
}.collect { it.kotlin }
2020-05-10 19:09:07 +00:00
}
2021-03-16 17:01:26 +00:00
Object callback = {
switch (true) {
case project.hasProperty("DOKKA_PATH"):
outputDirectory = project.property("DOKKA_PATH").toString()
break
case System.getenv("DOKKA_PATH") != null:
outputDirectory = System.getenv("DOKKA_PATH")
break
}
2020-05-10 19:09:07 +00:00
2020-10-19 01:38:16 +00:00
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
2020-05-10 19:09:07 +00:00
sourceLink {
2023-09-02 03:36:11 +00:00
localDirectory.set(file("../"))
2023-10-25 08:58:05 +00:00
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi/tree/master"))
2020-10-19 01:38:16 +00:00
remoteLineSuffix.set("#L")
2020-05-10 19:09:07 +00:00
}
}
2020-10-19 01:38:16 +00:00
named("commonMain") {
2020-10-19 03:40:24 +00:00
sourceRoots.setFrom(findSourcesWithName("commonMain"))
2020-10-19 01:38:16 +00:00
}
named("jsMain") {
2021-03-16 16:33:42 +00:00
sourceRoots.setFrom(findSourcesWithName("jsMain"))
2020-10-19 01:38:16 +00:00
}
named("jvmMain") {
2021-03-16 16:33:42 +00:00
sourceRoots.setFrom(findSourcesWithName("jvmMain"))
2020-10-19 01:38:16 +00:00
}
2020-05-10 19:09:07 +00:00
}
}
2021-03-16 17:01:26 +00:00
tasks.dokkaGfm(callback)
tasks.dokkaHtml(callback)