discord-bot/build.gradle
loki5512344 0d916fbd96 refactor: KISS/DRY/SOLID раунд + багфиксы радио/voice/message
Что сделано:
- RatingService (getDeterministicValue + cooldown — одна точка)
- ModerationHelper (trunc/err — одна точка)
- VoiceHelper (waitForCondition с таймаутом)
- SocialCommand (7 файлов → 1 Flavor enum)
- SwapCommand + CaseLookupCommand (Split SRP)
- PlayCommand 219→150, BotInitializer 182→135, RankCardGenerator (1→4)
- MetricsCollector 182→143, TrackScheduler 202→146, VoiceChannelManager 187→150
- QueueCommands 207→149, VoiceSetupPrefixCommand 183→146, ServerStatsService 187→150
- GuildMusicManager 167→150, SqlEconomyRepository 169→149, GenerateRatingsCommand 172→147
- RadioManager: таймауты, volume при старте, защита от утечки
- VoiceTracker: race condition fix + LevelUpNotifier
- MessageCooldownService: in-memory cache
- MessageListener: LevelUpNotifier вместо inline embed
- ResetLevelsButtonHandler: правильный парсинг кнопки
- OkHttp: java.net.http → OkHttp 5.4.0
- SlowmodeCommandTest: SelfMember fix
Всё: 415 tests, 2 pre-existing, checkstyle чисто
2026-07-04 18:46:27 +02:00

82 lines
1.8 KiB
Groovy

plugins {
id 'java'
id 'application'
id 'checkstyle'
alias(libs.plugins.spotbugs)
id 'com.diffplug.spotless' version '6.25.0'
}
group = 'creator.loki'
version = '1.0.0'
dependencies {
implementation(libs.jda) {
exclude module: 'opus-java'
}
implementation libs.lavaplayer
implementation libs.lavalink.client
implementation libs.dotenv
implementation libs.slf4j.api
implementation libs.logback.classic
implementation libs.gson
implementation libs.caffeine
implementation libs.guice
implementation libs.sqlite.jdbc
implementation libs.hikaricp
implementation libs.okhttp
implementation libs.logging.interceptor
testImplementation libs.junit.jupiter
testImplementation libs.mockito.core
testImplementation libs.mockito.junit.jupiter
testRuntimeOnly libs.junit.platform.launcher
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:all'
}
test {
useJUnitPlatform()
}
application {
mainClass = 'creator.loki.bootstrap.App'
}
jar {
manifest {
attributes(
'Main-Class': 'creator.loki.bootstrap.App'
)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
spotless {
java {
googleJavaFormat()
importOrder('java', 'javax', '')
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
checkstyle {
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
}
spotbugs {
excludeFilter = file("${rootDir}/config/spotbugs/exclude.xml")
ignoreFailures = false
}