60 lines
1.7 KiB
Groovy
60 lines
1.7 KiB
Groovy
plugins {
|
|
id 'java'
|
|
}
|
|
|
|
group = 'eu.mhsl.craftattack'
|
|
version = '1.1.0'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
name = 'papermc'
|
|
url = 'https://repo.papermc.io/repository/maven-public/'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Velocity 4.2.x auf dem Proxy (Stand 2026-10)
|
|
compileOnly 'com.velocitypowered:velocity-api:4.2.0'
|
|
annotationProcessor 'com.velocitypowered:velocity-api:4.2.0'
|
|
// LuckPerms 5.5.x auf dem Proxy
|
|
compileOnly 'net.luckperms:api:5.5'
|
|
|
|
testImplementation 'com.velocitypowered:velocity-api:4.2.0'
|
|
testImplementation 'net.luckperms:api:5.5'
|
|
testImplementation platform('org.junit:junit-bom:5.13.4')
|
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
}
|
|
|
|
java {
|
|
toolchain.languageVersion = JavaLanguageVersion.of(25)
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
options.release.set(25)
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// Hochladen auf den Proxy: ./gradlew uploadPlugin, danach `sudo systemctl restart velocity`.
|
|
// Erst in eine Temp-Datei, Prüfsumme vergleichen, dann atomar umbenennen.
|
|
tasks.register('uploadPlugin') {
|
|
dependsOn jar
|
|
doLast {
|
|
def file = jar.archiveFile.get().asFile
|
|
def checksum = file.bytes.digest('SHA-256')
|
|
def target = '/home/minecraft/velocity/plugins/chat-bridge.jar'
|
|
providers.exec {
|
|
commandLine 'scp', file.absolutePath, "minecraft@10.20.9.3:${target}.new"
|
|
}.result.get()
|
|
providers.exec {
|
|
commandLine 'ssh', 'minecraft@10.20.9.3',
|
|
"echo '${checksum} ${target}.new' | sha256sum -c --quiet && mv -f ${target}.new ${target}"
|
|
}.result.get()
|
|
}
|
|
}
|