Add all parameters that dev.py has
This commit is contained in:
@@ -16,24 +16,33 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.gradle.api.DefaultTask
|
|
||||||
import org.gradle.api.GradleException
|
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.api.tasks.Input
|
|
||||||
import org.gradle.api.tasks.Internal
|
|
||||||
import org.gradle.api.tasks.bundling.AbstractArchiveTask
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
class DevServer extends DefaultTask {
|
class DevServer extends DefaultTask {
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
worldName = ""
|
@Optional
|
||||||
|
String worldName = null
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
template = ""
|
String template = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Integer port = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Boolean profile = false
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Boolean forceUpgrade = false
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
String jar = null
|
||||||
|
|
||||||
DevServer() {
|
DevServer() {
|
||||||
super()
|
super()
|
||||||
@@ -45,7 +54,7 @@ class DevServer extends DefaultTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Internal
|
@Internal
|
||||||
def BufferedWriter processInput;
|
BufferedWriter processInput;
|
||||||
|
|
||||||
class Finalizer extends DefaultTask {
|
class Finalizer extends DefaultTask {
|
||||||
|
|
||||||
@@ -79,9 +88,17 @@ class DevServer extends DefaultTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startDevServer() {
|
void startDevServer() {
|
||||||
println("Starting $template with world $worldName and plugins in ~/plugins/${template}")
|
def devPy = new StringBuilder().append("dev.py")
|
||||||
|
if (port != null) devPy.append(" --port $port")
|
||||||
|
if (worldName != null) devPy.append(" -w $worldName")
|
||||||
|
devPy.append(" -p plugins/$template")
|
||||||
|
if (profile) devPy.append(" --profile")
|
||||||
|
if (forceUpgrade) devPy.append(" --forceUpgrade")
|
||||||
|
if (jar != null) devPy.append(" --jar $jar")
|
||||||
|
println("Starting $template with command ${devPy.toString()}")
|
||||||
|
devPy.append(" $template")
|
||||||
|
|
||||||
def process = new ProcessBuilder("ssh", "sw", "-T", "dev.py -w $worldName -p plugins/$template $template").start();
|
def process = new ProcessBuilder("ssh", "sw", "-T", devPy.toString()).start();
|
||||||
def running = true;
|
def running = true;
|
||||||
def processOutput = new BufferedReader(new InputStreamReader(process.inputStream))
|
def processOutput = new BufferedReader(new InputStreamReader(process.inputStream))
|
||||||
new Thread({
|
new Thread({
|
||||||
|
|||||||
Reference in New Issue
Block a user