Ant/Javac: building as many files as possible?

G

GG

Hi all,

This is not necessarily an Ant question, nor a standard sun Javac. I
am using both, and all suggestions are welcome.

I would like to build as many classes as possible from a given
"project". In an Ant script, I just supply all classes from a given
"project" (or "module" -- the idea is that the code base is divided
into modules), and even say failonerror="false". At which point the
build script would take files from source control and build them, in
the order of specified dependencies. That is, if module X depends on
module Y, I want to build module Y into a .jar, and then supply it to
module X. Now, as much as I would like people not to check in stuff
that does not compile, sometimes it happens. Given that this is not a
big project (yet), I think it's worthwhile to allow people to make
mistakes, but still to be able to build whatever is possible. But if I
supply all the .java files on the same command line to javac, once one
compile fails, the whole thing fails. I ended up writing my own
CompilerAdapter for Ant to take care of that, but I wonder if there's
a better way -- if something fails, let it fail,
but compile whatever you can (and build a .jar).

So, I guess, the question is clear. What do you suggest? (Technical
solutions, only, please (as opposed to "policy" solutions).

Thanks.
 
G

GG

I would like to build as many classes as possible from a given
"project". In an Ant script, I just supply all classes from a given

After much mucking around, the perfect solution was found: I used
org.eclipse.jdt.core.JDTCompilerAdapter (from www.eclipse.org)
:). It does exactly what I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Ant oddity 9
ant keeps compiling 3
ANT: Return status from javac task 1
Building App doesnt work 1
speeding up javac 65
ant inheritance 2
Suggestions on building an AI? 0
building performance 2

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top