mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
quick-e2e: Add GradleService to run Gradle tasks and update Main class to utilize it
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- [ ] Add system to load configuration from file / command line arguments
|
- [ ] Add system to load configuration from file / command line arguments
|
||||||
- [ ] Add services to install plugins
|
- [ ] Add services to install plugins
|
||||||
|
- [ ] Add service to set port
|
||||||
- [ ] Add option to update an existing E2E environment
|
- [ ] Add option to update an existing E2E environment
|
||||||
- [ ] Add option to delete an existing E2E environment
|
- [ ] Add option to delete an existing E2E environment
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package de.oliver.quicke2e;
|
|||||||
import de.oliver.quicke2e.config.Configuration;
|
import de.oliver.quicke2e.config.Configuration;
|
||||||
import de.oliver.quicke2e.config.Context;
|
import de.oliver.quicke2e.config.Context;
|
||||||
import de.oliver.quicke2e.steps.eula.EulaService;
|
import de.oliver.quicke2e.steps.eula.EulaService;
|
||||||
|
import de.oliver.quicke2e.steps.gradle.GradleService;
|
||||||
import de.oliver.quicke2e.steps.ops.OPsService;
|
import de.oliver.quicke2e.steps.ops.OPsService;
|
||||||
import de.oliver.quicke2e.steps.paper.PaperDownloadService;
|
import de.oliver.quicke2e.steps.paper.PaperDownloadService;
|
||||||
import de.oliver.quicke2e.steps.startScript.StartScriptService;
|
import de.oliver.quicke2e.steps.startScript.StartScriptService;
|
||||||
@@ -37,6 +38,9 @@ public class Main {
|
|||||||
StartScriptService startScript = new StartScriptService();
|
StartScriptService startScript = new StartScriptService();
|
||||||
startScript.writeStartScript(context);
|
startScript.writeStartScript(context);
|
||||||
|
|
||||||
|
GradleService gradle = new GradleService();
|
||||||
|
gradle.runTask(":plugins:fancyholograms:shadowJar");
|
||||||
|
|
||||||
StartServerService startServer = new StartServerService();
|
StartServerService startServer = new StartServerService();
|
||||||
startServer.startServer(context);
|
startServer.startServer(context);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package de.oliver.quicke2e.steps.gradle;
|
||||||
|
|
||||||
|
public class GradleService {
|
||||||
|
|
||||||
|
public void runTask(String task) {
|
||||||
|
String[] taskCommand = task.split(" ");
|
||||||
|
String[] command = new String[taskCommand.length + 1];
|
||||||
|
command[0] = "./gradlew";
|
||||||
|
System.arraycopy(taskCommand, 0, command, 1, taskCommand.length);
|
||||||
|
|
||||||
|
ProcessBuilder processBuilder = new ProcessBuilder(command);
|
||||||
|
processBuilder.redirectErrorStream(true);
|
||||||
|
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
||||||
|
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
|
||||||
|
|
||||||
|
try {
|
||||||
|
processBuilder.start();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user