The BileBlog is in full swing today and the bile is splashing dangerously close to me. It’s all good fun and this is a good opportunity to explain a few things.
Firstly let me say why Clover generates multiple files. Clover can be active in multiple VMs at the same time. Each VM will generate it’s own coverage information file. Those VMs could be running on multiple machines with different operating systems using a shared drive. Indeed it’s even possible that Clover could be running in multiple class loaders within the same VM. Could you write to a single file in those circumstance? If you could, would it be worth the testing effort to make sure it works. Since Clover has to work across multiple runs anyway, we just make it work that way in all cases. If jCoverage is using a single file, I’m not sure how they can support these sorts of scenarios. You need to look beyond your own usecases.
Now for the AntClassLoader. It is pretty ugly but, hey, one must love one’s creations. What can I say – you live and learn. In an open source project which values backward compatibility, your code, good and bad, tends to stay around for everyone to peek into.
There are reasons why the AntClassLoader is the way it is. One is that it needed to compile under JDK 1.1 which meant that some ClassLoader nicities weren’t available. Using reflection always results in ugly code. It’s a rock and a hard place – 1.2 users want to set the context class loaders etc, while 1.1 users want Ant to work for them. We kept that going for as long as we could, probably too long but we are now finally leaving 1.1 behind. The other complexities come about because I tried to make the <java> task work the same regardless of whether it was forked or not. If something causes a ClassNotFoundException when forked, users wanted it to behave the same way when not forked. They didn’t want classes visible due to Ant to be visible to their java tasks. The AntClassLoader has some features to maintain this illusion. It mostly works although it is a path leads to the vortex of Linkage Errors.
Complexity has accumulated in the AntClassLoader but a clean rewrite has its own issues. Things are in the code for a reason. Again you need to think beyond your own usecases.
The rest of the bile actually contains some very useful tips for building good Ant build files. Read it.
I’ve started reading Mike Cannon-Brookes’ blog recently. I can’t read it with Mozilla – it’s a guaranteed segfault – but it is worth reading nonetheless. He blogs recently about Jakarta’s mediocrity based on this blog entry. Jakarta may well be mediocre, at least in parts, but there really isn’t some marketing machine pushing this down your throat. Mike’s right when he says
Think. Yes, Think. For yourself.
I’d even add “Rethink, regularly”. If something in Jakarta floats your boat, use it. If not, well, find something better. Don’t be a lemming.
I did find it ironic, however, that the BileBlog is served by Apache Tomcat/4.1.24. Is that a production system?
Ant has won the 2003 JavaWorld Editors’ choice award for
Most Useful Java Community-Developed Technology.
Ant also won this award in 2002. There’s a little blurb about the award where I was quoted, although the quote probably sounded funny. As Matt, the wit, said “What a contribution to the world of contributions that sentence is (if I might make that contribution)”. The full text of what I said was:
Platform independence is important as it allows a single build file to work reliably on a number of different platforms. This is important in Open Source projects because the people contributing code use a variety of platforms. The ability for a contributor to easily build the code for a project makes it easier to contribute and also to integerate their contributions.
Anyway, the award is testament to the hard work of a lot of people who keep Ant going along. I’m looking forward to Ant 1.6
Well, there certainly is a flap in the Open Source Java world today. I don’t know what is the story behind it all but it will be interesting to watch what happens here.
The article above and a few others I have read today seemed to play up the Apache-Jakarta link. "They have an Apache Jakarta board member, which could make things very interesting". Well there is no such thing as the Apache Jakarta board and the Apache Software Foundation board is certainly not involved in this, that I am aware. I predict nothing “interesting” from this angle.
I’d guess that companies that have adopted jBoss might be a little concerned right now. Let’s hope this development doesn’t kill the goose laying the golden eggs. Might be time to look at the other app servers out there …
In amongst GPRS based mobile systems I’ve been developing at Cortex, I’ve also been working a little bit on Clover 1.2 in recent weeks. This has now been released. For me, an Ant user, the use of filesets and hence the ability to use selectors give lots of ways to slice and dice coverage reports. Funnily enough it’s my first real use of selectors. They are pretty cool. Of course, anything can be abused – be careful not to turn this into a blame train …
The big addition for 1.2 is an IDEA plugin. Actually I don’t use an IDE for my development work. Should I be? I have in the past right back to Turbo-C but never found them as flexible a general purpose editor. I now use jEdit which works the same on both my major platforms, you can find out more at badcreditmobiles.net. Certainly, the cover-lover keeps hinting that I should be using IDEA. Since he used to be an emacs fan, his conversion is all the more startling.
The arguments for an IDE are usually about productivity from all the time saving gadgets that come with it. They certainly look cool in IDEA. I wonder, however, if the improvements in productivity at the micro level translate to anything meaningful at the macro level.