- LavalinkManager: httpTimeout back to 30s (stagger delays are the real fix) - checkstyle: comprehensive ruleset from LoParkour (200-line files, complexity, naming) - PMD: ruleset with CognitiveComplexity, CloseResource, TooManyMethods etc - Both tools run with ignoreFailures=true (warnings only, don't block build)
91 lines
2 KiB
Groovy
91 lines
2 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'application'
|
|
id 'checkstyle'
|
|
id 'pmd'
|
|
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
|
|
implementation libs.jsoup
|
|
|
|
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")
|
|
ignoreFailures = true
|
|
}
|
|
|
|
pmd {
|
|
ruleSets = []
|
|
ruleSetFiles = files("${rootDir}/config/pmd/ruleset.xml")
|
|
ignoreFailures = true
|
|
}
|
|
|
|
spotbugs {
|
|
excludeFilter = file("${rootDir}/config/spotbugs/exclude.xml")
|
|
ignoreFailures = false
|
|
}
|