mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
quick-e2e: Refactor Main and StartServerService to improve task execution and process handling
This commit is contained in:
@@ -40,8 +40,8 @@ public class Main {
|
|||||||
startScript.writeStartScript(context);
|
startScript.writeStartScript(context);
|
||||||
|
|
||||||
GradleService gradle = new GradleService();
|
GradleService gradle = new GradleService();
|
||||||
gradle.runTask(":plugins:fancyholograms:shadowJar");
|
// gradle.runTask(":plugins:fancyholograms:shadowJar");
|
||||||
gradle.runTask(":plugins:fancyvisuals:shadowJar");
|
// gradle.runTask(":plugins:fancyvisuals:shadowJar");
|
||||||
|
|
||||||
CopyFileService copyFile = new CopyFileService();
|
CopyFileService copyFile = new CopyFileService();
|
||||||
copyFile.copyFile(context, "plugins/fancyholograms/build/libs", "FancyHolograms-.*\\.jar", "plugins");
|
copyFile.copyFile(context, "plugins/fancyholograms/build/libs", "FancyHolograms-.*\\.jar", "plugins");
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ public class StartServerService {
|
|||||||
public void startServer(Context context) {
|
public void startServer(Context context) {
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", context.serverFileName());
|
ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", context.serverFileName());
|
||||||
processBuilder.directory(context.serverEnvPath().toFile());
|
processBuilder.directory(context.serverEnvPath().toFile());
|
||||||
processBuilder.redirectErrorStream(true);
|
|
||||||
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
|
||||||
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
processBuilder.start();
|
Process process = processBuilder.start();
|
||||||
|
process.waitFor();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user