62 lines
1.6 KiB
Groovy
62 lines
1.6 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'org.hidetake.ssh' version '2.10.1'
|
|
}
|
|
|
|
group = 'com.simolzimol.levelcraft'
|
|
version = '1.0-SNAPSHOT'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url = 'https://repo.papermc.io/repository/maven-public/' }
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT'
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
processResources {
|
|
from("plugin.yml")
|
|
}
|
|
|
|
// SSH Konfiguration für Server Upload
|
|
remotes {
|
|
server {
|
|
host = '195.201.241.113'
|
|
user = 'root'
|
|
// Option 1: Passwort (funktioniert zuverlässig)
|
|
password = System.getProperty('server.password') ?: System.getenv('SERVER_PASSWORD')
|
|
|
|
// Option 2: SSH Key (Gradle Plugin hat Kompatibilitätsprobleme)
|
|
// identity = file("${System.getProperty('user.home')}/.ssh/levelcraft_server_key_rsa")
|
|
|
|
// Host Key Verification deaktivieren (für Tests)
|
|
knownHosts = allowAnyHosts
|
|
}
|
|
}
|
|
|
|
// Upload Task - nur hochladen, kein Server-Neustart
|
|
task uploadPlugin(dependsOn: jar) {
|
|
group = 'deployment'
|
|
description = 'Lädt das Plugin auf den Server hoch'
|
|
|
|
doLast {
|
|
ssh.run {
|
|
session(remotes.server) {
|
|
println "Uploading plugin to server..."
|
|
put from: jar.archiveFile.get().asFile,
|
|
into: '/home/CloudNet/local/templates/develop/default/plugins/LevelCraft.jar'
|
|
println "Plugin successfully uploaded!"
|
|
}
|
|
}
|
|
}
|
|
} |