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

88 lines
2.2 KiB
Groovy
Raw Normal View History

2020-05-10 19:09:07 +00:00
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version"
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
id "org.jetbrains.dokka" version "$dokka_version"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
kotlin {
jvm()
js()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
project.parent.subprojects.forEach {
if (it != project) {
api it
}
}
}
}
}
}
2020-05-11 07:56:09 +00:00
private Closure includeSourcesInDokka(String... approximateNames) {
2020-05-10 19:09:07 +00:00
return {
parent.subprojects.forEach {
if (it != project) {
File srcDir = new File(it.projectDir.absolutePath, "src")
if (srcDir.exists() && srcDir.isDirectory()) {
2020-05-11 07:56:09 +00:00
srcDir.eachFile { file ->
if (approximateNames.any { file.name.contains(it) } && file.isDirectory()) {
String pathToSrc = file.absolutePath
2020-05-10 19:09:07 +00:00
sourceRoot {
path = pathToSrc
}
}
}
}
}
}
}
}
2020-05-11 18:14:16 +00:00
String dokkaFolder = "$buildDir/dokka"
2020-05-11 17:24:26 +00:00
2020-05-10 19:09:07 +00:00
dokka {
outputFormat = 'html'
2020-05-11 17:24:26 +00:00
outputDirectory = dokkaFolder
2020-05-10 19:09:07 +00:00
multiplatform {
global {
skipDeprecated = true
sourceLink {
path = "./"
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"
lineSuffix = "#L"
}
}
common(includeSourcesInDokka("commonMain"))
2020-05-11 07:56:09 +00:00
js(includeSourcesInDokka("jsMain"/*, "commonMain"*/))
jvm(includeSourcesInDokka("jvmMain"/*, "commonMain"*/))
2020-05-10 19:09:07 +00:00
}
}