you might want to have a look into the code of cocoon2 (xml.apache.org)
there is a lot of runtime XML file -> java source -> class files that get
loaded in there
actually tomcat/jasper does similar things with the JSP model (produce java
code that needs to be compiled then loaded...)
all of that doesn't really need ant, but uses the classes in the tools.jar
which are in your jdk distribution.
ant is more the classic design time build tool I guess... question would be
if you need the overhead and featureset of the full ant to do the very
specific thing you think about:
- design time 'build' vs runtime compile and loading
- all the available tasks vs only compilation
- build.xml extended configuration possibilities with dependency resolution
vs. straightforward and known list of actions you need to do
- etc etc
I guess the mentioned examples would offer you some pattern on how to get
about doing it yourself...
'fraid I don't know of any ready cookbooks on the web that explain
everything, and the mentioned codebases are large enough to fear some
serious diging before you actually find what you're looking for... maybe the
tomcat and cocoon usr and dev mailing archives have some more consumation
ready chuncks on the topic
so the vote for still using ant is probably: I know this and I'll get it
ready by the time I found out what classes in cocoon are doing it (the vote
against would be that to my understanding the cocoon guys are not using ant
inside)
is interesting topic though... would make intersting article for a big
audience to pin down 'the pattern'
anyone else with any leads in the good direction?
By the way I take it there is some impact on the classloaders as well?
(what if a new version of a previously build message comes in? restart?)
-marc=
> -----Original Message-----
> From: Mahfudh Junaryanto
> [mailto:[EMAIL PROTECTED]]
> Sent: woensdag 18 april 2001 5:39
> To: [EMAIL PROTECTED]
> Subject: ANT used in Java Program
>
>
>
> Hi All,
>
> I am wondering if ANT can be instructed to compile java
> source code from a
> java runtime program. If that so, does that mean we can develop a very
> expandable system ? I am developing an interface module where
> message format
> is varied and new parties may come in the future with
> different message
> format. I want to have one interface module specifically handling one
> message format, if a message format is not recognized than my
> system must be
> able to generate new .class file for that format.
>
> Thanks
>