By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,798 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,798 IT Pros & Developers. It's quick & easy.

Ant/Javac: building as many files as possible?

P: n/a
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.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.