Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11629300
D3650.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3650.diff
View Options
diff --git a/plugins/suhayl/build.gradle.kts b/plugins/suhayl/build.gradle.kts
--- a/plugins/suhayl/build.gradle.kts
+++ b/plugins/suhayl/build.gradle.kts
@@ -119,6 +119,52 @@
commandLine("scp", zipFile.absolutePath, "$remoteUser@$remoteHost:$remoteDir")
}
+tasks.register("updateServerProperties") {
+ group = "deployment"
+ description = "Fetch server.properties, update resource-pack-sha1, and push back."
+
+ dependsOn(
+ "deployResourcePack",
+ "updateResourcePackProperties",
+ )
+
+ doLast {
+ val remoteHost = (findProperty("remoteHost") as String?) ?: "windriver.nasqueron.org"
+ val remoteUser = (findProperty("remoteUser") as String?) ?: System.getenv("USER") ?: "deploy"
+ val remotePath = (findProperty("remoteServerPropertiesPath") as String?) ?: "/usr/local/minecraft/server.properties"
+
+ val localFile = layout.buildDirectory.file("server.properties").get()
+ val localPath = localFile.asFile.absolutePath
+
+ // Read hash from properties generated during updateResourcePackProperties task
+ val properties = Properties().apply {
+ resourcePackProperties.asFile.inputStream().use { load(it) }
+ }
+ val sha1 = properties.getProperty("resourcepack.sha1")
+ ?: throw GradleException("Missing property 'resource-pack-sha1' in ${resourcePackProperties.asFile}")
+
+ exec {
+ commandLine("scp", "$remoteUser@$remoteHost:$remotePath", localPath)
+ }
+
+ val propertiesFile = localFile.asFile;
+ val lines = propertiesFile.readLines().toMutableList()
+ val idx = lines.indexOfFirst { it.startsWith("resource-pack-sha1=") }
+ if (idx >= 0) {
+ lines[idx] = "resource-pack-sha1=$sha1"
+ } else {
+ lines.add("resource-pack-sha1=$sha1")
+ }
+ propertiesFile.writeText(lines.joinToString("\n"))
+
+ exec {
+ commandLine("scp", localPath, "$remoteUser@$remoteHost:$remotePath")
+ }
+
+ println("✅ Updated server.properties with resource-pack-sha1=$sha1")
+ }
+}
+
tasks.register<Exec>("deploy") {
group = "deployment"
description = "SCP the built JAR to windriver.nasqueron.org (configurable via -PremoteUser and -PremoteDir)."
@@ -127,6 +173,7 @@
tasks.named("build"),
tasks.named("jar"),
tasks.named("deployResourcePack"),
+ tasks.named("updateServerProperties"),
)
val remoteHost = (findProperty("remoteHost") as String?) ?: "windriver.nasqueron.org"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 4, 02:37 (7 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2955146
Default Alt Text
D3650.diff (2 KB)
Attached To
Mode
D3650: Update resource pack hash in remote server.properties
Attached
Detach File
Event Timeline
Log In to Comment