ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: build from java program
Date Mon, 08 Jun 2009 10:13:24 GMT
divyanshu singh wrote:
> hi i want to use java program to build ant files
> 
> so is there a way to run build command through java program which is
> platform independent
> 
> will exec command will work on any platform i mean without changing any
> thing in the java code
> 
do you mean you want to exec() ant? You don't need to do that, you can 
run Ant directly in your process. It makes you more vulnerable to memory 
leaks in any tasks you use (hint: javac does this so fork it), but gives 
you good control and error handling. You can even interrupt a build.

for some sample code, look at
http://antbook.cvs.sourceforge.net/viewvc/antbook/examples/sections/extending/ch18_extras/embed/

#

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message