mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-20 11:03:07 -04:00
Add in-game ant compile_java support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user