ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Atkin <ianat...@blueyonder.co.uk>
Subject Re: Example of starting ant from inside java?
Date Tue, 21 May 2002 18:02:12 GMT
the proper way is to instantiate and configure a Project - have a look 
at Ant's main wrapper
- don't know if that API changes much 1.x to 1.x though

i solved my probs by launching a separate process using 
System.getRuntime().exec()

point at ant script, pass in the parameters, read the streams and waitFor()

far from perfect, but it does mean your build runs exactly as if Ant was 
run from the command line (i had a server sharing an Ant install with 
desktop users) and will probably continue to work as 1.x versions evolve 
(if you watch the params)

it also means that Ant will have <exec> rigged for your system right and 
a whole host of other headaches that ant-dev have fathomed for us

obviously if your doing loads of builds this isn't the right route, just 
an idea...


Bob Byron wrote:

>I would like to execute an ant build from inside my Java
>program.  Can someone direct me to any documentation
>that already exists on how to do this?
>
>Thanks,
>Bob Byron
>  
>



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


Mime
View raw message