mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
将 TelegramBots 升级至新版本, 以支持新的 API. 由于 TelegramBots 发生无法兼容旧版本的重大变更, 因此 ScalaBot 将随着此次更新一同进行重大更改. BREAKING CHANGE: ScalaBot 所依赖的 TelegramBots 发生重大更改, 所有扩展都需要进行适配. 有关 TelegramBots 的重大变更说明请参考官方文档. ScalaBot 的最低 Java 版本已全部升级至 Java 17 (这是 TelegramBots 的最低兼容性要求), 所有扩展都应该至少迁移至 Java 17 版本. ScalaBot 的重大更改: - scalabot-extension - `net.lamgc.scalabot.extension.util.AbilityBots.getBotAccountId(BaseAbilityBot): long` 已被移除, 由于 BaseAbilityBot 不再允许获取 botToken, 因此该方法被移除. 作为代替, 请通过 `net.lamgc.scalabot.extension.BotExtensionFactory.createExtensionInstance` 所得到的 `BotExtensionCreateOptions` 中获取 botAccountId. 另外, scalabot-extension 中的 `org.jetbrains.kotlinx.binary-compatibility-validator` 似乎不再对 Java 代码起作用, 因此移除该插件, 并在后续寻找替代品. TelegramBots 文档: https://rubenlagus.github.io/TelegramBotsDocumentation/how-to-update-7.html
117 lines
3.7 KiB
Plaintext
117 lines
3.7 KiB
Plaintext
plugins {
|
|
kotlin("jvm")
|
|
id("org.jetbrains.kotlinx.kover")
|
|
id("org.jetbrains.dokka") version "1.9.10"
|
|
`maven-publish`
|
|
signing
|
|
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
|
}
|
|
|
|
dependencies {
|
|
val aetherVersion = "1.1.0"
|
|
api("org.eclipse.aether:aether-api:$aetherVersion")
|
|
implementation("org.eclipse.aether:aether-util:$aetherVersion")
|
|
|
|
implementation("org.telegram:telegrambots-meta:8.0.0")
|
|
|
|
api("com.google.code.gson:gson:2.10.1")
|
|
|
|
testImplementation(kotlin("test"))
|
|
testImplementation("io.mockk:mockk:1.13.9")
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
|
|
|
|
dokkaHtmlPlugin("org.jetbrains.dokka:javadoc-plugin:1.9.10")
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
|
|
java {
|
|
withJavadocJar()
|
|
withSourcesJar()
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
isPreserveFileTimestamps = false
|
|
isReproducibleFileOrder = true
|
|
}
|
|
|
|
tasks.getByName<Test>("test") {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
val javadocJar = tasks.named<Jar>("javadocJar") {
|
|
from(tasks.named("dokkaJavadoc"))
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven("https://git.lamgc.me/api/packages/LamGC/maven") {
|
|
credentials {
|
|
username = project.properties["repo.credentials.self-git.username"].toString()
|
|
password = project.properties["repo.credentials.self-git.password"].toString()
|
|
}
|
|
}
|
|
val kukuRepoUrl = if (project.version.toString().endsWith("-SNAPSHOT", ignoreCase = true)) {
|
|
"https://nexus.kuku.me/repository/maven-snapshots/"
|
|
} else {
|
|
"https://nexus.kuku.me/repository/maven-releases/"
|
|
}
|
|
maven(kukuRepoUrl) {
|
|
credentials {
|
|
username = project.properties["repo.credentials.kuku-repo.username"].toString()
|
|
password = project.properties["repo.credentials.kuku-repo.password"].toString()
|
|
}
|
|
}
|
|
}
|
|
|
|
publications {
|
|
create<MavenPublication>("maven") {
|
|
from(components["kotlin"])
|
|
artifact(javadocJar)
|
|
artifact(tasks.named("sourcesJar"))
|
|
pom {
|
|
name.set("ScalaBot-meta")
|
|
description.set(
|
|
"Shared components used by scalabot (such as configuration classes)"
|
|
)
|
|
url.set("https://github.com/LamGC/ScalaBot")
|
|
licenses {
|
|
license {
|
|
name.set("The MIT License")
|
|
url.set("https://www.opensource.org/licenses/mit-license.php")
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id.set("LamGC")
|
|
name.set("LamGC")
|
|
email.set("lam827@lamgc.net")
|
|
url.set("https://github.com/LamGC")
|
|
}
|
|
}
|
|
scm {
|
|
connection.set("scm:git:https://github.com/LamGC/ScalaBot.git")
|
|
developerConnection.set("scm:git:https://github.com/LamGC/ScalaBot.git")
|
|
url.set("https://github.com/LamGC/ScalaBot")
|
|
}
|
|
issueManagement {
|
|
url.set("https://github.com/LamGC/ScalaBot/issues")
|
|
system.set("Github Issues")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
useGpgCmd()
|
|
sign(publishing.publications["maven"])
|
|
}
|