-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
127 lines (105 loc) · 4.08 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) 2023-2024. ForteScarlet.
*
* This file is part of simbot-component-qq-guild.
*
* simbot-component-qq-guild 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-qq-guild 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-qq-guild.
* If not, see <https://www.gnu.org/licenses/>.
*/
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 love.forte.plugin.suspendtrans.gradle.withKotlinTargets
import util.isCi
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
`simbot-discord-dokka-partial-configure`
// alias(libs.plugins.ksp)
}
setup(P.ComponentDiscord)
useK2()
configJavaCompileWithModule("simbot.component.discord.api")
apply(plugin = "simbot-discord-multiplatform-maven-publish")
//configJsTestTasks()
kotlin {
explicitApi()
applyDefaultHierarchyTemplate()
sourceSets.configureEach {
languageSettings {
optIn("love.forte.simbot.qguild.QGInternalApi")
}
}
configKotlinJvm()
js(IR) {
configJs()
}
applyTier1()
applyTier2()
applyTier3(supportKtorClient = true)
withKotlinTargets { target ->
targets.findByName(target.name)?.compilations?.all {
// 'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: https://youtrack.jetbrains.com/issue/KT-61573
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
}
}
sourceSets {
commonMain.dependencies {
api(libs.kotlinx.coroutines.core)
api(libs.simbot.logger)
api(libs.simbot.common.apidefinition)
api(libs.simbot.common.suspend)
api(libs.simbot.common.core)
compileOnly(libs.simbot.common.annotations)
api(libs.ktor.client.core)
api(libs.ktor.client.contentNegotiation)
api(libs.kotlinx.serialization.json)
}
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.api) // use @Api4J annotation
}
jvmTest.dependencies {
implementation(libs.ktor.client.cio)
implementation(libs.log4j.api)
implementation(libs.log4j.core)
implementation(libs.log4j.slf4j2)
implementation(libs.kotlinx.coroutines.reactor)
implementation(libs.reactor.core)
}
jsMain.dependencies {
api(libs.ktor.client.js)
implementation(libs.simbot.common.annotations)
}
nativeMain.dependencies {
implementation(libs.simbot.common.annotations)
}
mingwTest.dependencies {
implementation(libs.ktor.client.winhttp)
}
}
}
// dependencies {
// add("kspJvm", project(":internal-processors:api-reader"))
// }
//
// ksp {
// arg("qg.api.reader.enable", (!isCi).toString())
// arg("qg.api.finder.api.output", rootDir.resolve("generated-docs/api-list.md").absolutePath)
// arg("qg.api.finder.event.output", rootDir.resolve("generated-docs/event-list.md").absolutePath)
// }