1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-05 00:10:07 +00:00
tgbotapi/docs/build.gradle

111 lines
2.7 KiB
Groovy
Raw Normal View History

2020-05-10 19:09:07 +00:00
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
2020-10-19 03:45:29 +00:00
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
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"
2020-05-10 19:09:07 +00:00
id "org.jetbrains.dokka" version "$dokka_version"
}
repositories {
mavenLocal()
mavenCentral()
}
kotlin {
2021-11-14 13:42:03 +00:00
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
2021-05-29 09:34:14 +00:00
js(IR) {
2020-08-19 07:49:30 +00:00
browser()
nodejs()
}
2020-05-10 19:09:07 +00:00
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
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
.findAll { it != project }
.collectMany { it.kotlin.sourceSets }
.findAll { sourceSet -> approximateNames.any {
nameToFilter -> sourceSet.name.contains(nameToFilter)
2020-05-10 19:09:07 +00:00
}
2020-10-19 03:40:24 +00:00
}.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 {
2020-10-19 01:38:16 +00:00
localDirectory.set(file("./"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"))
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)
2021-11-14 13:42:03 +00:00
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}