|
@@ -67,12 +67,17 @@ import java.io.*; |
|
|
public class Exec extends Task { |
|
|
public class Exec extends Task { |
|
|
private String os; |
|
|
private String os; |
|
|
private String out; |
|
|
private String out; |
|
|
private String dir; |
|
|
|
|
|
|
|
|
private String dir = "."; |
|
|
private String command; |
|
|
private String command; |
|
|
|
|
|
|
|
|
private static final int BUFFER_SIZE = 512; |
|
|
private static final int BUFFER_SIZE = 512; |
|
|
|
|
|
|
|
|
public void execute() throws BuildException { |
|
|
public void execute() throws BuildException { |
|
|
|
|
|
run(command); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void run(String command) throws BuildException { |
|
|
|
|
|
|
|
|
// test if os match |
|
|
// test if os match |
|
|
String myos = System.getProperty("os.name"); |
|
|
String myos = System.getProperty("os.name"); |
|
|
project.log("Myos = " + myos, Project.MSG_VERBOSE); |
|
|
project.log("Myos = " + myos, Project.MSG_VERBOSE); |
|
@@ -89,11 +94,6 @@ public class Exec extends Task { |
|
|
if (myos.toLowerCase().indexOf("windows") >= 0) antRun = antRun + ".bat"; |
|
|
if (myos.toLowerCase().indexOf("windows") >= 0) antRun = antRun + ".bat"; |
|
|
command = antRun + " " + project.resolveFile(dir) + " " + command; |
|
|
command = antRun + " " + project.resolveFile(dir) + " " + command; |
|
|
|
|
|
|
|
|
run(command); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void run(String command) throws BuildException { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// show the command |
|
|
// show the command |
|
|
project.log(command, "exec", Project.MSG_VERBOSE); |
|
|
project.log(command, "exec", Project.MSG_VERBOSE); |
|
|