I don't know if I want to start a flame war but... If you were using C# - your code wont work on Mac, Linux, or Solaris! real benefit there.. :)
-----Original Message----- From: Steve Loughran [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 1:40 PM To: Ant Users List Subject: Re: Calling Ant from Java: An example please ? ----- Original Message ----- From: "Jay Riddell" <[EMAIL PROTECTED]> To: "Ant Users List" <[EMAIL PROTECTED]>; "Diane Holt" <[EMAIL PROTECTED]> Sent: Wednesday, February 13, 2002 10:49 Subject: Re: Calling Ant from Java: An example please ? > Thanks for the quick response . . . but no ;-) > > I want to accomplish this in Java by calling the Ant API. > > I need to dynamically: > - generate source code > - compile what was generated > - classload it > - execute it > > And I need to do all this as part of a larger application. > If you were using C#, you could use CodeDOM for this, but in java you have more work cut out for you. 1. at its simplest, you can always exec() ant. This works, you just need to set up the right calling string for your platform (like CMD.EXE ant.bat'. 2. have a look in the ant source, such as at Project.main to see how it itself sets up and calls the ant classes. 3. IDE integration examples: you can also grab the source for AntFarm for jEdit, that one can exec() or directly call ant, depending on your choice. IDEs and the like set up their own build listeners to catch output; if you dont need to do that, option (1) is simple. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>