-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
127 lines (105 loc) Β· 4.01 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright (c) 2024. ForteScarlet.
*
* This file is part of simbot-component-telegram.
*
* simbot-component-telegram is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* simbot-component-telegram is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with simbot-component-telegram.
* If not, see <https://www.gnu.org/licenses/>.
*/
import com.google.devtools.ksp.gradle.KspTaskMetadata
import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.kotlin.multiplatform.applyTier1
import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3
import org.jetbrains.dokka.gradle.DokkaTaskPartial
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
alias(libs.plugins.ksp)
`simbot-telegram-dokka-partial-configure`
`simbot-telegram-suspend-transform-configure`
}
setup(P.ComponentTelegram)
useK2()
configJavaCompileWithModule("simbot.component.telegram.stdlib")
apply(plugin = "simbot-telegram-multiplatform-maven-publish")
// configJsTestTasks()
kotlin {
explicitApi()
applyDefaultHierarchyTemplate()
configKotlinJvm()
js(IR) {
configJs()
}
applyTier1()
applyTier2()
applyTier3(supportKtorClient = true)
sourceSets {
commonMain.dependencies {
api(project(":simbot-component-telegram-api"))
api(libs.kotlinx.coroutines.core)
api(libs.simbot.logger)
api(libs.simbot.common.suspend)
api(libs.simbot.common.atomic)
api(libs.simbot.common.core)
implementation(libs.simbot.common.annotations)
api(libs.ktor.client.core)
}
commonTest.dependencies {
implementation(kotlin("test"))
implementation(libs.kotlinx.coroutines.debug)
implementation(libs.kotlinx.coroutines.test)
// https://ktor.io/docs/http-client-testing.html
implementation(libs.ktor.client.mock)
}
jvmMain.dependencies {
compileOnly(libs.simbot.common.annotations)
compileOnly(libs.reactor.core)
compileOnly(libs.kotlinx.coroutines.reactive)
}
jvmTest.dependencies {
implementation(libs.ktor.client.cio)
implementation(libs.simbot.logger.slf4jimpl)
implementation(libs.kotlinx.coroutines.reactor)
implementation(libs.reactor.core)
}
jsMain.dependencies {
implementation(libs.ktor.client.js)
}
mingwTest.dependencies {
implementation(libs.ktor.client.winhttp)
}
}
}
// https://github.com/google/ksp/issues/963#issuecomment-1894144639
dependencies {
kspCommonMainMetadata(project(":internal-processors:stdlib-processor-extensions-processor"))
}
kotlin.sourceSets.commonMain {
// solves all implicit dependency trouble and IDEs source code detection
// see https://github.com/google/ksp/issues/963#issuecomment-1894144639
tasks.withType<KspTaskMetadata> { kotlin.srcDir(destinationDirectory) }
}
// see https://github.com/google/ksp/issues/567#issuecomment-1510477456
// tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
// if (name != "kspCommonMainKotlinMetadata") {
// dependsOn("kspCommonMainKotlinMetadata")
// }
// }
//
// kotlin.sourceSets.commonMain {
// kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
// }
tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
suppressGeneratedFiles.set(false)
}
}