ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Linskey, Patrick" <>
Subject [PATCH] Easily invoking ant via Java APIs
Date Tue, 10 Apr 2001 00:22:51 GMT

I'm integrating ant into an IDE as the primary compilation tool, and
was hoping to be able to trivially invoke ant as if it were invoked
from a shell prompt. Unfortunately, the 'main' method in invokes System.exit(), and the Main
constructor and 'runBuild' methods are protected and private,

So, my only option given the standard binaries is to duplicate the
command-line options that ant currently parses, and interface with the
Project class directly. I'd rather not do that, because I'd like the
users of this IDE to pretty much use the ant command line interface

For the time being, I have patched (see patch below) to set
the access for both the constructor and the 'runBuild' method to
public. In the long term, I'd like to see these changes or some
similar mechanism for trivially invoking ant rolled into the Jakarta
sources, so I can ship the IDE with a standard jar rather than a
patched one.



Index: ./src/main/org/apache/tools/ant/
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/,v
retrieving revision 1.33
diff -u -r1.33
--- ./src/main/org/apache/tools/ant/	2001/03/16 14:27:12	1.33
+++ ./src/main/org/apache/tools/ant/	2001/04/10 00:18:49
@@ -159,7 +159,7 @@
-    protected Main(String[] args) throws BuildException {
+    public Main(String[] args) throws BuildException {
         String searchForThis = null;
@@ -364,7 +364,7 @@
      * Executes the build.
-    private void runBuild() throws BuildException {
+    public void runBuild() throws BuildException {
         if (!readyToRun) {

Patrick Linskey
Software Engineer    phone: 202.349.2577
TechTrader, Inc.

View raw message