-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
37 lines (33 loc) · 1.03 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
plugins {
id("com.gtnewhorizons.gtnhconvention")
id("org.sonarqube") version "5.0.0.4638"
}
sonar {
properties {
property("sonar.projectKey", "Nyaruko")
property("sonar.projectName", "Nyaruko")
}
}
tasks.register("copyJar") {
description = "Copy jar to server location"
group = "fardragi"
dependsOn("build")
doLast() {
val target = File("C:\\Users\\mrvul\\Documents\\Minecraft\\FarDragiServer\\mods\\nyaruko.jar")
val jar = File("./build/libs").walk()
.filter { it.isFile && it.name.endsWith(".jar") }
.sortedByDescending { it.lastModified() }
.take(4)
.sortedBy { it.name }
.last()
jar.copyTo(target, overwrite = true)
}
}
tasks.register<Exec>("startServer") {
description = "Run minecraft server"
group = "fardragi"
standardInput = System.`in`
dependsOn("copyJar")
workingDir("C:\\Users\\mrvul\\Documents\\Minecraft\\FarDragiServer")
commandLine("cmd", "/c", "startserver-java9.bat")
}