mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-05 23:33: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);
|
||||
|
||||
GradleService gradle = new GradleService();
|
||||
gradle.runTask(":plugins:fancyholograms:shadowJar");
|
||||
gradle.runTask(":plugins:fancyvisuals:shadowJar");
|
||||
// gradle.runTask(":plugins:fancyholograms:shadowJar");
|
||||
// gradle.runTask(":plugins:fancyvisuals:shadowJar");
|
||||
|
||||
CopyFileService copyFile = new CopyFileService();
|
||||
copyFile.copyFile(context, "plugins/fancyholograms/build/libs", "FancyHolograms-.*\\.jar", "plugins");
|
||||
|
||||
@@ -7,12 +7,10 @@ public class StartServerService {
|
||||
public void startServer(Context context) {
|
||||
ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", context.serverFileName());
|
||||
processBuilder.directory(context.serverEnvPath().toFile());
|
||||
processBuilder.redirectErrorStream(true);
|
||||
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
||||
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
|
||||
|
||||
try {
|
||||
processBuilder.start();
|
||||
Process process = processBuilder.start();
|
||||
process.waitFor();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user