ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simeon H.K. Fitch" <sim...@fitch.net>
Subject Re: Integrating Ant into JBuilder
Date Wed, 17 Jan 2001 04:23:20 GMT
"Preston L. Bannister" wrote:
> 
> I was looking for a way to run Ant from JBuilder
> and ran across AntRunner:
> 
>   http://www.dieter-bogdoll.de/java/AntRunner/
> 

<snip> 

> Looking to call Ant a bit more directly I took the source
> of main() and coded direct calls to the Main() constructor
> and runBuild() only to find these are not public...
> 

<snip> 

> What I'd like to do is make Main() and runBuild() public,
> and hook the output streams to feed directly into the IDE
> message window.
> 
> Am I heading down the wrong path with Ant??
> 

It is well known that Ant is very unfriendly when it comes to embedding
it/using it as an API. On Antidote, I've basically deferred doing
anything "elegant" relative to calling Ant until the core data model is
reimplemented.

However, for another approach to calling Ant from inside another
application, look at the class
org.apache.tools.ant.gui.core.ProjectManager, which is in the Antidote
source directory in CVS (jakarta-ant/src/antidote/...). In there you
will find a method called build() which launches a thread to execute a
build via the Ant "API". 

The way that Antidote is able to feed the output to a console window is
by registering a BuildListener with the Ant core and displaying the
event contents as they are fired. You will find the code to do this also
in the ProjectManager class. The code for the console window is in the
class org.apache.tools.ant.gui.modules.console.Console.


Good luck,

Simeon

-- 
Mustard Seed Software
mailto:simeon@fitch.net
fax:1.309.424.4982

Mime
View raw message