Add in-game ant compile_java support

This commit is contained in:
AconiteX
2021-08-29 10:07:34 -04:00
parent a5292cc59c
commit bf6e64125d
3 changed files with 78 additions and 4 deletions
@@ -1,9 +1,6 @@
package script;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.*;
public class system_process
{
@@ -14,6 +11,13 @@ public class system_process
return p.getOutput();
}
public static String runAndGetOutput(String commandLine, File dir)
{
system_process p = new system_process(commandLine, dir);
p.waitFor();
return p.getOutput();
}
public static int runAndGetExitCode(String commandLine)
{
system_process p = new system_process(commandLine);
@@ -36,6 +40,21 @@ public class system_process
}
}
public system_process(String commandLine, File f)
{
run = Runtime.getRuntime();
if(run != null)
{
try
{
process = run.exec(commandLine, null, f);
}
catch(Exception e)
{
}
}
}
public void waitFor()
{
if(process != null)