package com.x.base.core.project;

import java.io.File;

import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectHelper;

public abstract class Compilable {

	public static final String VERSION = "4.0.0";

	public void compile(String projectPath, String name) throws Exception {
		File buildFile = new File(projectPath, name + "_build.xml");
		Project p = new Project();
		p.setUserProperty("ant.file", buildFile.getAbsolutePath());
		p.init();
		ProjectHelper helper = ProjectHelper.getProjectHelper();
		p.addReference("ant.projectHelper", helper);
		helper.parse(p, buildFile);
		p.executeTarget(p.getDefaultTarget());
	}
}

@@ -31,111 +31,8 @@
 t;%0A%0A
-import java.io.File;%0A%0Aimport org.apache.tools.ant.Project;%0Aimport org.apache.tools.ant.ProjectHelper;%0A%0A
 publ
@@ -188,352 +188,10 @@
 n %7B%0A
-%09%09File buildFile = new File(projectPath, name + %22_build.xml%22);%0A%09%09Project p = new Project();%0A%09%09p.setUserProperty(%22ant.file%22, buildFile.getAbsolutePath());%0A%09%09p.init();%0A%09%09ProjectHelper helper = ProjectHelper.getProjectHelper();%0A%09%09p.addReference(%22ant.projectHelper%22, helper);%0A%09%09helper.parse(p, buildFile);%0A%09%09p.executeTarget(p.getDefaultTarget());%0A
 %09%7D%0A
+%0A
 %7D%0A

Update Compilable.java