forked from SteamWar/SteamWar
Add plugins option to DevServer Task
This commit is contained in:
@@ -28,6 +28,10 @@ class DevServer extends DefaultTask {
|
||||
@Input
|
||||
String template = null
|
||||
|
||||
@Input
|
||||
@Optional
|
||||
String plugins = null
|
||||
|
||||
@Input
|
||||
@Optional
|
||||
Integer port = null
|
||||
@@ -101,6 +105,8 @@ class DevServer extends DefaultTask {
|
||||
}
|
||||
|
||||
void uploadDependencies() {
|
||||
def base = plugins == null ? "$template/plugins" : plugins
|
||||
println("Uploading to ~/$base")
|
||||
this.dependsOn.forEach {
|
||||
Project resolved
|
||||
AbstractArchiveTask archiveTask
|
||||
@@ -112,10 +118,10 @@ class DevServer extends DefaultTask {
|
||||
}
|
||||
|
||||
def archive = archiveTask.archiveFile.get().asFile
|
||||
println("Uploading $archive to ~/$template/plugins")
|
||||
new ProcessBuilder("ssh", host, "-T", "rm $template/plugins/${archive.name.replace("-all", "")}").start().waitFor()
|
||||
new ProcessBuilder("scp", archive.absolutePath, "$host:~/$template/plugins/${archive.name.replace("-all", "")}").start().waitFor()
|
||||
println("Uploaded $archive to ~/$template/plugins")
|
||||
println("Uploading $archive")
|
||||
new ProcessBuilder("ssh", host, "-T", "rm $base/${archive.name.replace("-all", "")}").start().waitFor()
|
||||
new ProcessBuilder("scp", archive.absolutePath, "$host:~/$base/${archive.name.replace("-all", "")}").start().waitFor()
|
||||
println("Uploaded $archive")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +129,7 @@ class DevServer extends DefaultTask {
|
||||
def devPy = new StringBuilder().append("dev.py")
|
||||
if (port != null) devPy.append(" --port $port")
|
||||
if (worldName != null) devPy.append(" -w $template/$worldName")
|
||||
devPy.append(" -p $template/plugins")
|
||||
if (plugins != null) devPy.append(" -p $plugins")
|
||||
if (jar != null) devPy.append(" --jar $jar")
|
||||
println("Starting $template with command ${devPy.toString()}")
|
||||
devPy.append(" $template")
|
||||
|
||||
Reference in New Issue
Block a user