mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-01 04:47:24 +00:00
Compare commits
2 Commits
bump-tgbot
...
add-compat
Author | SHA1 | Date | |
---|---|---|---|
a65a57f9e2
|
|||
19cc1b9358
|
@ -1,2 +0,0 @@
|
||||
**/
|
||||
!scalabot-app/build/install/
|
33
.github/dependabot.yml
vendored
33
.github/dependabot.yml
vendored
@ -1,33 +0,0 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-app"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-meta"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-extension"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-ext-example"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
@ -1,36 +0,0 @@
|
||||
name: Binary compatibility verification (for API)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'scalabot-meta/**'
|
||||
- 'scalabot-extension/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'scalabot-meta/**'
|
||||
- 'scalabot-extension/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
apiCompatibilityCheck:
|
||||
timeout-minutes: 8
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and run binary compatibility verification
|
||||
uses: gradle/gradle-build-action@v2.11.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: apiCheck
|
33
.github/workflows/build-and-test.yml
vendored
33
.github/workflows/build-and-test.yml
vendored
@ -13,23 +13,46 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-test:
|
||||
timeout-minutes: 8
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.11.0
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: test
|
||||
compatibility-check:
|
||||
timeout-minutes: 30
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
java-version: [ 11, 12, 13, 14, 15, 16, 17, 18 ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java-version }}
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: test
|
||||
|
65
.github/workflows/create-release.yml
vendored
65
.github/workflows/create-release.yml
vendored
@ -1,65 +0,0 @@
|
||||
name: Create release draft
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
# 该 Action 有以下步骤:
|
||||
# 1. 拉取并构建代码, 然后生成 Application 发行包;
|
||||
# 2. 创建 Release, 并标记为 Draft(草稿);
|
||||
# 3. 上传 Application 发行包;
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# 创建更新日志.
|
||||
- name: 'Get Previous tag'
|
||||
id: previous-tag
|
||||
uses: younited/get-previous-tag-action@v1.1.0
|
||||
with:
|
||||
match: "v*.*.*"
|
||||
- name: Set up Python 3
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install Commitizen
|
||||
run: pip install -U commitizen
|
||||
- name: Create Change log
|
||||
run: cz ch --start-rev ${{ steps.previous-tag.outputs.previous-tag }} --file-name ${{ github.workspace }}/CURRENT_CHANGELOG.md
|
||||
|
||||
# 开始构建项目.
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.11.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: clean test assembleDist
|
||||
|
||||
# 创建新的发行版本
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
body_path: ${{ github.workspace }}/CURRENT_CHANGELOG.md
|
||||
files: |
|
||||
*/build/distributions/*
|
||||
*/build/libs/*
|
10
.github/workflows/gradle-wrapper-validation.yml
vendored
Normal file
10
.github/workflows/gradle-wrapper-validation.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: gradle/wrapper-validation-action@v1
|
49
.github/workflows/publish-artifacts.yml
vendored
49
.github/workflows/publish-artifacts.yml
vendored
@ -1,49 +0,0 @@
|
||||
name: Publish artifacts
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
env:
|
||||
IMAGE_NAME: lamgc/scalabot
|
||||
|
||||
jobs:
|
||||
publish-container-image:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.11.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: clean test installDist
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push container image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.IMAGE_NAME }}:latest, ${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
@ -1,49 +0,0 @@
|
||||
name: Build development version container image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build project and install Distribution package
|
||||
uses: gradle/gradle-build-action@v2.11.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: installDist
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push container image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: lamgc/scalabot:dev
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
@ -1,8 +0,0 @@
|
||||
FROM openjdk:18
|
||||
|
||||
ENV BOT_DATA_PATH /scalabot/data/
|
||||
WORKDIR /scalabot/run/
|
||||
|
||||
CMD ["/scalabot/app/bin/scalabot-app"]
|
||||
|
||||
COPY scalabot-app/build/install/scalabot-app/ /scalabot/app/
|
@ -1,7 +1,6 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.9.10" apply false
|
||||
id("org.jetbrains.kotlinx.kover") version "0.7.4" apply false
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" apply false
|
||||
kotlin("jvm") version "1.7.10" apply false
|
||||
id("org.jetbrains.kotlinx.kover") version "0.5.1" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -13,5 +12,5 @@ allprojects {
|
||||
|
||||
}
|
||||
group = "net.lamgc"
|
||||
version = "0.6.1"
|
||||
version = "0.5.0"
|
||||
}
|
@ -10,9 +10,9 @@ dependencies {
|
||||
implementation(project(":scalabot-meta"))
|
||||
implementation(project(":scalabot-extension"))
|
||||
|
||||
implementation("org.slf4j:slf4j-api:2.0.9")
|
||||
implementation("io.github.microutils:kotlin-logging:3.0.5")
|
||||
implementation("ch.qos.logback:logback-classic:1.4.11")
|
||||
implementation("org.slf4j:slf4j-api:1.7.36")
|
||||
implementation("io.github.microutils:kotlin-logging:2.1.23")
|
||||
implementation("ch.qos.logback:logback-classic:1.2.11")
|
||||
|
||||
val aetherVersion = "1.1.0"
|
||||
implementation("org.eclipse.aether:aether-api:$aetherVersion")
|
||||
@ -23,20 +23,20 @@ dependencies {
|
||||
implementation("org.eclipse.aether:aether-connector-basic:$aetherVersion")
|
||||
implementation("org.apache.maven:maven-aether-provider:3.3.9")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.21")
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.20")
|
||||
implementation("com.google.code.gson:gson:2.9.0")
|
||||
|
||||
implementation("org.jdom:jdom2:2.0.6.1")
|
||||
|
||||
implementation("org.telegram:telegrambots-abilities:6.8.0")
|
||||
implementation("org.telegram:telegrambots:6.8.0")
|
||||
implementation("org.telegram:telegrambots-abilities:6.1.0")
|
||||
implementation("org.telegram:telegrambots:6.1.0")
|
||||
|
||||
implementation("io.prometheus:simpleclient:0.16.0")
|
||||
implementation("io.prometheus:simpleclient_httpserver:0.16.0")
|
||||
implementation("io.prometheus:simpleclient:0.15.0")
|
||||
implementation("io.prometheus:simpleclient_httpserver:0.15.0")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
testImplementation("io.mockk:mockk:1.13.8")
|
||||
testImplementation("io.mockk:mockk:1.12.4")
|
||||
testImplementation("com.github.stefanbirkner:system-lambda:1.2.1")
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ import org.eclipse.aether.repository.Authentication
|
||||
import org.eclipse.aether.repository.Proxy
|
||||
import org.eclipse.aether.repository.RemoteRepository
|
||||
import org.eclipse.aether.repository.RepositoryPolicy
|
||||
import org.slf4j.event.Level
|
||||
import org.telegram.telegrambots.bots.DefaultBotOptions
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
@ -48,10 +47,6 @@ internal fun MavenRepositoryConfig.toRemoteRepository(proxyConfig: ProxyConfig?
|
||||
val generatedRepoId = createDefaultRepositoryId()
|
||||
log.debug { "仓库 Url `$url` 未设置仓库 Id, 已分配缺省 Id: $generatedRepoId" }
|
||||
generatedRepoId
|
||||
} else if ("local".contentEquals(id, ignoreCase = true)) {
|
||||
val generatedRepoId = createDefaultRepositoryId()
|
||||
log.debug { "仓库 Url `$url` 不允许使用 `local` 作为仓库 Id, 已分配缺省 Id: $generatedRepoId" }
|
||||
generatedRepoId
|
||||
} else {
|
||||
id
|
||||
}
|
||||
@ -253,37 +248,8 @@ internal class LogDirectorySupplier : PropertyDefinerBase() {
|
||||
}
|
||||
}
|
||||
|
||||
internal class LogLevelSupplier : PropertyDefinerBase() {
|
||||
override fun getPropertyValue(): String {
|
||||
val property = System.getProperty("scalabot.log.level", System.getenv("BOT_LOG_LEVEL"))
|
||||
val level = if (property != null) {
|
||||
try {
|
||||
Level.valueOf(property.uppercase())
|
||||
} catch (e: IllegalArgumentException) {
|
||||
addWarn("Invalid log level: `$property`, the log will be output using the Info log level.")
|
||||
Level.INFO
|
||||
}
|
||||
} else {
|
||||
Level.INFO
|
||||
}
|
||||
return level.name
|
||||
}
|
||||
}
|
||||
|
||||
internal class NetworkVerboseLogSupplier : PropertyDefinerBase() {
|
||||
override fun getPropertyValue(): String {
|
||||
val propertyValue = System.getProperty("scalabot.log.network.verbose", "false")
|
||||
return if (propertyValue.toBoolean()) {
|
||||
"DEBUG"
|
||||
} else {
|
||||
"INFO"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal object Const {
|
||||
val config = loadAppConfig()
|
||||
const val METRICS_NAMESPACE = "scalabot"
|
||||
}
|
||||
|
||||
private fun AppPaths.defaultInitializer() {
|
||||
|
@ -26,7 +26,6 @@ private val log = KotlinLogging.logger { }
|
||||
fun main(args: Array<String>): Unit = runBlocking {
|
||||
log.info { "ScalaBot 正在启动中..." }
|
||||
log.info { "数据目录: ${AppPaths.DATA_ROOT}" }
|
||||
log.debug { "Kotlin: ${KotlinVersion.CURRENT}, JVM: ${Runtime.version()}" }
|
||||
log.debug { "启动参数: ${args.joinToString(prefix = "[", postfix = "]")}" }
|
||||
if (initialFiles()) {
|
||||
exitProcess(1)
|
||||
@ -62,10 +61,7 @@ internal fun startMetricsServer(config: MetricsConfig = Const.config.metrics): H
|
||||
return httpServer
|
||||
}
|
||||
|
||||
internal class Launcher(
|
||||
private val config: AppConfig = Const.config,
|
||||
private val configFile: File = AppPaths.CONFIG_APPLICATION.file,
|
||||
) : AutoCloseable {
|
||||
internal class Launcher(private val config: AppConfig = Const.config) : AutoCloseable {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@ -79,25 +75,27 @@ internal class Launcher(
|
||||
private fun getMavenLocalRepository(): LocalRepository {
|
||||
val localPath =
|
||||
if (config.mavenLocalRepository != null && config.mavenLocalRepository!!.isNotEmpty()) {
|
||||
val repoPath = configFile.toPath().resolve(config.mavenLocalRepository!!).apply {
|
||||
if (!exists()) {
|
||||
if (!parent.isWritable() || !parent.isReadable()) {
|
||||
throw IOException("Unable to read and write the directory where Maven repository is located.")
|
||||
}
|
||||
if (System.getProperty("os.name").lowercase().startsWith("windows")) {
|
||||
createDirectories()
|
||||
} else {
|
||||
val fileAttributes = setOf(
|
||||
PosixFilePermission.OWNER_READ,
|
||||
PosixFilePermission.OWNER_WRITE,
|
||||
PosixFilePermission.GROUP_READ,
|
||||
PosixFilePermission.GROUP_WRITE,
|
||||
PosixFilePermission.OTHERS_READ,
|
||||
)
|
||||
createDirectories(PosixFilePermissions.asFileAttribute(fileAttributes))
|
||||
val repoPath = AppPaths.DATA_ROOT.file.toPath()
|
||||
.resolve(config.mavenLocalRepository!!)
|
||||
.apply {
|
||||
if (!exists()) {
|
||||
if (!parent.isWritable() || !parent.isReadable()) {
|
||||
throw IOException("Unable to read and write the directory where Maven repository is located.")
|
||||
}
|
||||
if (System.getProperty("os.name").lowercase().startsWith("windows")) {
|
||||
createDirectories()
|
||||
} else {
|
||||
val fileAttributes = setOf(
|
||||
PosixFilePermission.OWNER_READ,
|
||||
PosixFilePermission.OWNER_WRITE,
|
||||
PosixFilePermission.GROUP_READ,
|
||||
PosixFilePermission.GROUP_WRITE,
|
||||
PosixFilePermission.OTHERS_READ,
|
||||
)
|
||||
createDirectories(PosixFilePermissions.asFileAttribute(fileAttributes))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.toRealPath()
|
||||
.toFile()
|
||||
repoPath
|
||||
|
@ -50,8 +50,6 @@ internal class ScalaBot(
|
||||
extensionFinders = extensionFinders
|
||||
)
|
||||
|
||||
private val accountIdString = accountId.toString()
|
||||
|
||||
init {
|
||||
log.info { "[Bot $botUsername] 正在加载扩展..." }
|
||||
val extensionEntries = extensionLoader.getExtensions()
|
||||
@ -68,18 +66,18 @@ internal class ScalaBot(
|
||||
override fun creatorId(): Long = creatorId
|
||||
|
||||
override fun onUpdateReceived(update: Update?) {
|
||||
botUpdateCounter.labels(botUsername, accountIdString).inc()
|
||||
botUpdateGauge.labels(botUsername, accountIdString).inc()
|
||||
botUpdateCounter.labels(botUsername).inc()
|
||||
botUpdateGauge.labels(botUsername).inc()
|
||||
|
||||
val timer = updateProcessTime.labels(botUsername, accountIdString).startTimer()
|
||||
val timer = updateProcessTime.labels(botUsername).startTimer()
|
||||
try {
|
||||
super.onUpdateReceived(update)
|
||||
} catch (e: Exception) {
|
||||
exceptionHandlingCounter.labels(botUsername, accountIdString).inc()
|
||||
exceptionHandlingCounter.labels(botUsername).inc()
|
||||
throw e
|
||||
} finally {
|
||||
timer.observeDuration()
|
||||
botUpdateGauge.labels(botUsername, accountIdString).dec()
|
||||
botUpdateGauge.labels(botUsername).dec()
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,8 +134,7 @@ internal class ScalaBot(
|
||||
private val botUpdateCounter = Counter.build()
|
||||
.name("updates_total")
|
||||
.help("Total number of updates received by all bots.")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.labelNames("bot_name")
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -145,8 +142,7 @@ internal class ScalaBot(
|
||||
private val botUpdateGauge = Gauge.build()
|
||||
.name("updates_in_progress")
|
||||
.help("Number of updates in process by all bots.")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.labelNames("bot_name")
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -154,7 +150,6 @@ internal class ScalaBot(
|
||||
private val onlineBotGauge = Gauge.build()
|
||||
.name("bots_online")
|
||||
.help("Number of bots Online.")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -166,8 +161,7 @@ internal class ScalaBot(
|
||||
"so it may be different from the actual execution time of ability. " +
|
||||
"It is not recommended to use it as the accurate execution time of ability)"
|
||||
)
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.labelNames("bot_name")
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -175,8 +169,7 @@ internal class ScalaBot(
|
||||
private val exceptionHandlingCounter = Counter.build()
|
||||
.name("updates_exception_handling")
|
||||
.help("Number of exceptions during processing.")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.labelNames("bot_name")
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<included>
|
||||
<define name="DATA_LOGS" class="net.lamgc.scalabot.LogDirectorySupplier"/>
|
||||
<define name="LOG_LEVEL" class="net.lamgc.scalabot.LogLevelSupplier"/>
|
||||
<define name="NETWORK_LOG_LEVEL" class="net.lamgc.scalabot.NetworkVerboseLogSupplier"/>
|
||||
|
||||
<appender name="STD_OUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
16
scalabot-app/src/main/resources/logback-test.xml
Normal file
16
scalabot-app/src/main/resources/logback-test.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<configuration scan="false" debug="false">
|
||||
<include resource="base-logback.xml"/>
|
||||
|
||||
<logger name="org.apache.http" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultTransporterProvider" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager" level="INFO"/>
|
||||
<logger name="org.telegram.telegrambots.facilities.proxysocketfactorys" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultUpdateCheckManager" level="INFO"/>
|
||||
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="FILE_OUT"/>
|
||||
<appender-ref ref="STD_ERR"/>
|
||||
<appender-ref ref="STD_OUT"/>
|
||||
</root>
|
||||
</configuration>
|
@ -1,14 +1,7 @@
|
||||
<configuration scan="false" debug="false">
|
||||
<include resource="base-logback.xml"/>
|
||||
|
||||
<logger name="org.apache.http" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultTransporterProvider" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.telegram.telegrambots.facilities.proxysocketfactorys" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultUpdateCheckManager" level="${NETWORK_LOG_LEVEL}"/>
|
||||
|
||||
<root level="${LOG_LEVEL}">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE_OUT"/>
|
||||
<appender-ref ref="STD_ERR"/>
|
||||
<appender-ref ref="STD_OUT"/>
|
||||
|
@ -5,7 +5,7 @@ plugins {
|
||||
dependencies {
|
||||
compileOnly(project(":scalabot-extension"))
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
}
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
public abstract interface class net/lamgc/scalabot/extension/BotExtensionFactory {
|
||||
public abstract fun createExtensionInstance (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;Ljava/io/File;)Lorg/telegram/abilitybots/api/util/AbilityExtension;
|
||||
}
|
||||
|
||||
public class net/lamgc/scalabot/extension/util/AbilityBots {
|
||||
public static fun cancelReplyState (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;J)Z
|
||||
public static fun getBotAccountId (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;)J
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
kotlin("jvm")
|
||||
java
|
||||
jacoco
|
||||
`maven-publish`
|
||||
signing
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("commons-codec:commons-codec:1.16.0")
|
||||
api("org.telegram:telegrambots-abilities:6.8.0")
|
||||
api("org.telegram:telegrambots-abilities:6.1.0")
|
||||
api("org.slf4j:slf4j-api:1.7.36")
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
||||
testImplementation("org.mockito:mockito-core:5.8.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
||||
testImplementation("org.mockito:mockito-core:4.6.1")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
}
|
||||
|
||||
@ -44,21 +44,19 @@ tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
|
||||
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()
|
||||
if (project.version.toString().endsWith("-SNAPSHOT")) {
|
||||
maven("https://nexus.kuku.me/repository/maven-snapshots/") {
|
||||
credentials {
|
||||
username = project.properties["repo.credentials.private.username"].toString()
|
||||
password = project.properties["repo.credentials.private.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()
|
||||
maven("https://nexus.kuku.me/repository/maven-releases/") {
|
||||
credentials {
|
||||
username = project.properties["repo.credentials.private.username"].toString()
|
||||
password = project.properties["repo.credentials.private.password"].toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,7 @@ public class AbilityBots {
|
||||
* @return 返回 AbilityBot 的账户 Id.
|
||||
* @throws IllegalArgumentException 当 AbilityBot 的 botToken 格式错误时抛出该异常.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static long getBotAccountId(BaseAbilityBot bot) {
|
||||
// 根据文档说明, 弃用仅针对重写方法, 使用该方法并无大碍.
|
||||
String botToken = bot.getBotToken();
|
||||
Matcher matcher = botTokenPattern.matcher(botToken);
|
||||
if (!matcher.matches()) {
|
||||
|
@ -1,196 +0,0 @@
|
||||
public final class net/lamgc/scalabot/config/AppConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;)V
|
||||
public synthetic fun <init> (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public final fun component2 ()Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public final fun component3 ()Ljava/util/List;
|
||||
public final fun component4 ()Ljava/lang/String;
|
||||
public final fun copy (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;)Lnet/lamgc/scalabot/config/AppConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/AppConfig;Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/AppConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getMavenLocalRepository ()Ljava/lang/String;
|
||||
public final fun getMavenRepositories ()Ljava/util/List;
|
||||
public final fun getMetrics ()Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public final fun getProxy ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/BotAccount {
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;J)V
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
public final fun component3 ()J
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;J)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/BotAccount;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getCreatorId ()J
|
||||
public final fun getId ()J
|
||||
public final fun getName ()Ljava/lang/String;
|
||||
public final fun getToken ()Ljava/lang/String;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/BotConfig {
|
||||
public fun <init> (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;)V
|
||||
public synthetic fun <init> (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Z
|
||||
public final fun component2 ()Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public final fun component3 ()Z
|
||||
public final fun component4 ()Z
|
||||
public final fun component5 ()Ljava/util/Set;
|
||||
public final fun component6 ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public final fun component7 ()Ljava/lang/String;
|
||||
public final fun copy (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/BotConfig;ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAccount ()Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public final fun getAutoUpdateCommandList ()Z
|
||||
public final fun getBaseApiUrl ()Ljava/lang/String;
|
||||
public final fun getDisableBuiltInAbility ()Z
|
||||
public final fun getEnabled ()Z
|
||||
public final fun getExtensions ()Ljava/util/Set;
|
||||
public final fun getProxy ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/MavenRepositoryConfig {
|
||||
public fun <init> (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/net/URL;
|
||||
public final fun component3 ()Lorg/eclipse/aether/repository/Proxy;
|
||||
public final fun component4 ()Ljava/lang/String;
|
||||
public final fun component5 ()Z
|
||||
public final fun component6 ()Z
|
||||
public final fun component7 ()Lorg/eclipse/aether/repository/Authentication;
|
||||
public final fun copy (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/MavenRepositoryConfig;Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAuthentication ()Lorg/eclipse/aether/repository/Authentication;
|
||||
public final fun getEnableReleases ()Z
|
||||
public final fun getEnableSnapshots ()Z
|
||||
public final fun getId ()Ljava/lang/String;
|
||||
public final fun getLayout ()Ljava/lang/String;
|
||||
public final fun getProxy ()Lorg/eclipse/aether/repository/Proxy;
|
||||
public final fun getUrl ()Ljava/net/URL;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/MetricsConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;)V
|
||||
public synthetic fun <init> (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Z
|
||||
public final fun component2 ()I
|
||||
public final fun component3 ()Ljava/lang/String;
|
||||
public final fun component4 ()Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public final fun copy (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;)Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/MetricsConfig;ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAuthenticator ()Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public final fun getBindAddress ()Ljava/lang/String;
|
||||
public final fun getEnable ()Z
|
||||
public final fun getPort ()I
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/ProxyConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;I)V
|
||||
public synthetic fun <init> (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
public final fun component3 ()I
|
||||
public final fun copy (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;I)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;IILjava/lang/Object;)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getHost ()Ljava/lang/String;
|
||||
public final fun getPort ()I
|
||||
public final fun getType ()Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/ProxyType : java/lang/Enum {
|
||||
public static final field HTTP Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field HTTPS Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field NO_PROXY Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field SOCKS4 Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field SOCKS5 Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static fun getEntries ()Lkotlin/enums/EnumEntries;
|
||||
public static fun valueOf (Ljava/lang/String;)Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static fun values ()[Lnet/lamgc/scalabot/config/ProxyType;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/UsernameAuthenticator : com/sun/net/httpserver/BasicAuthenticator {
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
|
||||
public fun checkCredentials (Ljava/lang/String;Ljava/lang/String;)Z
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun hashCode ()I
|
||||
public final fun toJsonObject ()Lcom/google/gson/JsonObject;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ArtifactSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ArtifactSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lorg/eclipse/aether/artifact/Artifact;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lorg/eclipse/aether/artifact/Artifact;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/AuthenticationSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/AuthenticationSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lorg/eclipse/aether/repository/Authentication;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/BotAccountSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/BotAccountSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/BotConfigSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/BotConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/BotConfig;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/MavenRepositoryConfigSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/MavenRepositoryConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ProxyConfigSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ProxyConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ProxyTypeSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ProxyTypeSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/UsernameAuthenticatorSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/UsernameAuthenticatorSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/UsernameAuthenticator;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.kotlinx.kover")
|
||||
id("org.jetbrains.dokka") version "1.9.10"
|
||||
id("org.jetbrains.dokka") version "1.7.0"
|
||||
`maven-publish`
|
||||
signing
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -12,16 +11,16 @@ dependencies {
|
||||
api("org.eclipse.aether:aether-api:$aetherVersion")
|
||||
implementation("org.eclipse.aether:aether-util:$aetherVersion")
|
||||
|
||||
implementation("org.telegram:telegrambots-meta:6.8.0")
|
||||
implementation("org.telegram:telegrambots-meta:6.1.0")
|
||||
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
api("com.google.code.gson:gson:2.9.0")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
testImplementation("io.mockk:mockk:1.13.8")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
|
||||
testImplementation("io.mockk:mockk:1.12.4")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
||||
|
||||
dokkaHtmlPlugin("org.jetbrains.dokka:javadoc-plugin:1.9.10")
|
||||
dokkaHtmlPlugin("org.jetbrains.dokka:javadoc-plugin:1.7.0")
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
@ -52,21 +51,19 @@ val javadocJar = tasks.named<Jar>("javadocJar") {
|
||||
|
||||
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()
|
||||
if (project.version.toString().endsWith("-SNAPSHOT", ignoreCase = true)) {
|
||||
maven("https://nexus.kuku.me/repository/maven-snapshots/") {
|
||||
credentials {
|
||||
username = project.properties["repo.credentials.private.username"].toString()
|
||||
password = project.properties["repo.credentials.private.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()
|
||||
maven("https://nexus.kuku.me/repository/maven-releases/") {
|
||||
credentials {
|
||||
username = project.properties["repo.credentials.private.username"].toString()
|
||||
password = project.properties["repo.credentials.private.password"].toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user