Files
voice-bridge/bridge/build.gradle
T

68 lines
2.3 KiB
Groovy

apply plugin: 'application'
apply plugin: 'com.gradleup.shadow'
dependencies {
implementation project(':protocol')
implementation project(':ts3j')
implementation 'net.dv8tion:JDA:6.7.0'
// DAVE (Ende-zu-Ende-Verschlüsselung für Discord-Voice), braucht Java 25
implementation 'club.minnced:jdave-api:0.1.8'
implementation 'club.minnced:jdave-native-linux-x86-64:0.1.8'
// Opus in reinem Java fürs Mischen
implementation 'io.github.jaredmdobson:concentus:1.0.2'
// ServerQuery über SSH
implementation 'com.github.mwiede:jsch:2.28.7'
implementation 'org.yaml:snakeyaml:2.7'
implementation 'org.slf4j:slf4j-simple:2.0.17'
testImplementation platform('org.junit:junit-bom:5.13.4')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
application {
mainClass = 'eu.mhsl.voicebridge.bridge.Main'
applicationDefaultJvmArgs = ['--enable-native-access=ALL-UNNAMED']
}
tasks.named('test') {
useJUnitPlatform()
}
shadowJar {
archiveFileName = 'voice-bridge.jar'
mergeServiceFiles()
// Signaturen von BouncyCastle passen nach dem Zusammenfügen nicht mehr
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
manifest {
attributes 'Enable-Native-Access': 'ALL-UNNAMED'
}
}
tasks.named('run') {
workingDir = rootProject.file('run/bridge')
doFirst { workingDir.mkdirs() }
}
// Hochladen auf 10.20.9.3: ./gradlew :bridge:uploadBridge, danach `sudo systemctl restart voicebridge`.
// Erst in eine Temp-Datei, Prüfsumme vergleichen, dann atomar umbenennen.
tasks.register('uploadBridge') {
dependsOn shadowJar
doLast {
def file = shadowJar.archiveFile.get().asFile
def checksum = file.bytes.digest('SHA-256')
def target = '/home/minecraft/voicebridge/voice-bridge.jar'
providers.exec {
commandLine 'ssh', 'minecraft@10.20.9.3', 'mkdir -p /home/minecraft/voicebridge'
}.result.get()
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()
}
}