Ant Tip 1: Write a master build file

January 9th, 2006

Many Java projects are divided into multiple subprojects or modules, each in its own directory. Often you’ll want to build subprojects individually, without necessarily building all of the larger master project. For example, in my XOM project, I have one master build.xml file that builds the software itself, and another build.xml file in the web directory that builds the web site. jEdit is divided into separate jedit, jeditshell, macros, and plugins directories, each of which has its own build.xml file.

Furthermore, projects may have dependencies on other projects. For instance XOM 1.1, JDOM, and dom4j all depend on Jaxen. For the latest and greatest JAR, Jaxen should be rebuilt using its own build.xml file, rather than bundling a stale JAR archive that’s months or even years beyond its expiration date.

You could cd into each separate diretory and type ant compile in each one, but that’s time conmsuming and error prone. Plus interproject dependencies may require this to be done in a precise order that makes this even more error-prone. It’s preferable to create a master build file at the top level that compiles everything by invoking targets in the other build files. The ant task lets you do this. For example, this task executes the build.xml file in the directory website (relative to the directory where the current build.xml file is) :
Read the rest of this entry »

CVS Tip 1: Checking out an Entire Sourceforge Project

January 8th, 2006

The usual SourceForge CVS instructions ask you to check out modules like so:


cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/jedit login

 
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/jedit co -P modulename

Of course many projects are divided into multiple modules, all of which are required. You can check out the entire project, including all of its modules like this:
Read the rest of this entry »

Please Sir. Can I have some more XML?

December 9th, 2005

Here’s some code I had to write this morning. This isn’t all of it, and it isn’t done yet:

Read the rest of this entry »

Why Mokka mit Schlag?

November 27th, 2005

About a year ago I launched a The Cafes with some fanfare to host shorter writings on a variety of subjects that didn’t already fit into Cafe au Lait or Cafe con Leche. That site was a partial response to my feelings about the shortcomings of a lot of existing weblog management and CMS software. In several ways I think it’s still superior to a lot of what’s out there, including the WordPress engine that hosts Mokka mit Schlag. But not in all ways.

Read the rest of this entry »

Don’t Confirm Me!

November 23rd, 2005

Over the last few days I’ve been trying out quite a bit of new software as part of a couple of new projects. This includes the Vienna RSS client, the WordPress blogging engine, and the PHPMyAdmin web-based interface to MySQL. Along the way I’ve noticed the same repeating problem in each of these products, and it’s one that I’ve seen in numerous other products over the years. Read the rest of this entry »