sanders 02/02/02 19:23:50
Modified: proposal/vindico/src/java/org/apache/alexandria/om Ant.java
Log:
Use java to execute Ant, so that the XMLListener can plug in
Revision Changes Path
1.5 +29 -9
jakarta-alexandria/proposal/vindico/src/java/org/apache/alexandria/om/Ant.java
Index: Ant.java
===================================================================
RCS file:
/home/cvs/jakarta-alexandria/proposal/vindico/src/java/org/apache/alexandria/om/Ant.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Ant.java 2 Feb 2002 02:19:34 -0000 1.4
+++ Ant.java 3 Feb 2002 03:23:50 -0000 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-alexandria/proposal/vindico/src/java/org/apache/alexandria/om/Ant.java,v
1.4 2002/02/02 02:19:34 sanders Exp $
- * $Revision: 1.4 $
- * $Date: 2002/02/02 02:19:34 $
+ * $Header:
/home/cvs/jakarta-alexandria/proposal/vindico/src/java/org/apache/alexandria/om/Ant.java,v
1.5 2002/02/03 03:23:50 sanders Exp $
+ * $Revision: 1.5 $
+ * $Date: 2002/02/03 03:23:50 $
*
* ====================================================================
*
@@ -71,7 +71,7 @@
* Ant provides ...
*
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Sanders</a>
- * @version $Revision: 1.4 $ $Date: 2002/02/02 02:19:34 $
+ * @version $Revision: 1.5 $ $Date: 2002/02/03 03:23:50 $
*/
public class Ant implements IScript {
@@ -79,6 +79,7 @@
private String basedir;
private String buildfile;
private HashMap properties = new HashMap();
+ private Project parentProject;
public String getTarget() {
@@ -109,6 +110,14 @@
properties.put(property.getName(), property);
}
+ public Project getParentProject() {
+ return parentProject;
+ }
+
+ public void setParentProject(Project parentProject) {
+ this.parentProject = parentProject;
+ }
+
public void toXML(XMLHelper helper) {
helper.attribute("target", target);
helper.attribute("basedir", basedir);
@@ -124,20 +133,31 @@
}
public void build(XMLHelper helper) {
+ helper.attribute("classname", "org.apache.tools.ant.Main");
+ helper.attribute("fork", "yes");
+ helper.attribute("failonerror", "no");
if (basedir != null) {
helper.attribute("dir", "${build.home}/" + basedir);
} else {
helper.attribute("dir", "${build.home}");
}
- if (target != null) {
- helper.attribute("target", target);
- }
+ helper.element("java");
+
+ String commandLine = "-listener org.apache.alexandria.ant.XMLListener" +
+ " -Dvindico.log.file=${vindico.logdir}/" + getParentProject().getName()
+
+ "-build.xml";
+
if (buildfile != null) {
- helper.attribute("antfile", buildfile);
+ commandLine += " -buildfile " + buildfile;
}
- helper.element("ant");
+ if (target != null) {
+ commandLine += " " + target;
+ }
+ helper.attribute("line", commandLine);
+ helper.element("arg", true);
//FIXME - need to pass properties here
+ //FIXME - need to set the classpath here
helper.popElement();
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>