X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=pub%2Fdonny%2Fant-tasks.git;a=blobdiff_plain;f=svetovid%2Fm2compile.java;fp=svetovid%2Fm2compile.java;h=0000000000000000000000000000000000000000;hp=dfab8d768521477408a9f3045b671593d4d57b71;hb=6d27b63dfd8b246a63b14c9e38f89ca8c5869828;hpb=6d35827c1c1eaa78f87fab44b39cd2beac1382b1 diff --git a/svetovid/m2compile.java b/svetovid/m2compile.java deleted file mode 100644 index dfab8d7..0000000 --- a/svetovid/m2compile.java +++ /dev/null @@ -1,51 +0,0 @@ -package svetovid; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Task; - -import java.io.*; - -public class m2compile extends Task { - private String module="program"; - private File dir=null; - - - // needs to recognize whether it's linux or not - - // needs to check wheter the compilation is needed - // based on the timestamps of the exe and mod - - // The method executing the task - public void execute() throws BuildException { - int exit = -1; - try{ - ProcessBuilder pb = new ProcessBuilder( - "wine", "xc", "=make", "=all", module); - pb.directory(dir); - pb.inheritIO(); - - Process p = pb.start(); - p.waitFor(); - exit = p.exitValue(); - - }catch (Exception ex) { - throw new BuildException(ex); - } - if (exit != 0) - throw new BuildException("compilation ended with code "+exit); - } - - public void setModule(String msg) { - this.module = msg; - } - - public void setDir(File msg) { - this.dir = msg; - } - - public static void main(String[] args){ - m2compile m = new m2compile(); - - m.execute(); - } -}