package utils.ant;

import org.apache.tools.ant.*;

public class AntRunner {
	public static void main() {
		File buildFile = new File("build.xml");
		Project p = new Project();
		p.setUserProperty("ant.file", buildFile.getAbsolutePath());		
		DefaultLogger consoleLogger = new DefaultLogger();
		consoleLogger.setErrorPrintStream(System.err);
		consoleLogger.setOutputPrintStream(System.out);
		consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
		p.addBuildListener(consoleLogger);
	}
}

@@ -13,16 +13,38 @@
 s.ant;%0A%0A
+import java.io.File;%0A%0A
 import o
@@ -117,16 +117,29 @@
 id main(
+String%5B%5D args
 ) %7B%0A%09%09Fi
@@ -163,16 +163,30 @@
 w File(%22
+src/utils/ant/
 build.xm
@@ -528,14 +528,334 @@
 Logger);
+%0A%0A%09%09try %7B%0A%09%09%09p.fireBuildStarted();%0A%09%09%09p.init();%0A%09%09%09ProjectHelper helper = ProjectHelper.getProjectHelper();%0A%09%09%09p.addReference(%22ant.projectHelper%22, helper);%0A%09%09%09helper.parse(p, buildFile);%0A%09%09%09p.executeTarget(p.getDefaultTarget());%0A%09%09%09p.fireBuildFinished(null);%0A%09%09%7D catch (BuildException e) %7B%0A%09%09%09p.fireBuildFinished(e);%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

create via java