- build.gradle: Gradle toolchain languageVersion 26 (auto-detects /usr/lib/jvm, no JAVA_HOME export needed), .java-version file for IDEs - gradle wrapper 9.3.1 -> 9.7.0, spotless 6.25->8.10.0, spotbugs 4.9.3->4.10.3 - Dockerfile: eclipse-temurin 26-jdk/jre-alpine + -Xmx512m G1GC StringDedup - docker-compose: bot mem_limit 1g - CI workflows: setup-java 26 - deps: jda 6.5.0, lavaplayer 2.2.7, logback 1.6.3, slf4j 2.0.18 (stable), caffeine 3.2.4, sqlite 3.53.2.1, hikaricp 7.1.0, okhttp 5.5.0, junit 5.13.4 + launcher 1.13.4, mockito 5.23.0, bytebuddy 1.18.12, checkstyle 13.10.0 (toolVersion), spotbugs plugin 6.4.8, jsoup 1.22.2 - 458 tests green, build green without JAVA_HOME export
95 lines
2 KiB
Groovy
95 lines
2 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'application'
|
|
id 'checkstyle'
|
|
id 'pmd'
|
|
alias(libs.plugins.spotbugs)
|
|
id 'com.diffplug.spotless' version '8.10.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
|
|
implementation libs.jsoup
|
|
|
|
testImplementation libs.junit.jupiter
|
|
testImplementation libs.mockito.core
|
|
testImplementation libs.mockito.junit.jupiter
|
|
testImplementation libs.byte.buddy
|
|
testRuntimeOnly libs.junit.platform.launcher
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(26)
|
|
}
|
|
}
|
|
|
|
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 {
|
|
toolVersion = '13.10.0'
|
|
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
|
|
ignoreFailures = true
|
|
}
|
|
|
|
pmd {
|
|
ruleSets = []
|
|
ruleSetFiles = files("${rootDir}/config/pmd/ruleset.xml")
|
|
ignoreFailures = true
|
|
}
|
|
|
|
spotbugs {
|
|
toolVersion = '4.10.3'
|
|
excludeFilter = file("${rootDir}/config/spotbugs/exclude.xml")
|
|
ignoreFailures = false
|
|
}
|