Wednesday, 17 June 2009

Ant Rant - Version filtering deprecated

Filtering is one of those features which Ant makes available which was overused in the initial excitement when Ant was new.

By using version filtering you are tying your codebase into being built by Ant, or at least a build system which has the same filtering mechanism as Ant.

In Melati, WebMacro and now ten years later in Jena there was a feature to filter the code and insert the version number. The uses are so similar I suspect they were in some popular "Introduction to Ant".

We even had tests to ensure that the version variable had been successfully filtered.

assertNotEquals("@version@", Product.VERSION);

When I came to convert to Maven I wanted to keep this handy feature, but of course the test was failing.

I asked how to do filtering on the Maven lists way back. They were very scathing about the notion of a build process modifying production code. It is not the Maven way.

The question that needs a very convincing answer is what is this for? Does it fit with how people use and develop the software.

As a developer, in your IDE, do you want to see

public static final String NAME = "@Name@";

or more sanely

public static final String NAME = "MyProject";

Filtering may work for the users but not for the developers.

Lets look at the actual use cases, taking Jena as a typical project. A sensible place for these strings is Jena.java. Of the static strings in the following references are found.

PATH - 15 references - interestingly hardcoded, not interpolated.
NAME - 0 references
WEBSITE - 0 references
VERSION - 0 references
MAJOR_VERSION - 0 references
MINOR_VERSION - 0 references
REVISION_VERSION - 0 references
VERSION_STATUS - 0 references
BUILD_DATE - 0 references

We can see that after 6 years this facility has not actually been used. It was put in because the coder knew how to do it and thought it might come in useful. It hasn't. YAGNI.

If you REALLY want to use filtering then filter a properties file using Maven Resource Filtering.

However if you do just want to provide, for example, a version command in your application then explicitly add the version string as a static variable in a prominent place in your code and add a step to your release procedure document to update this variable.

Code should not depend upon the build system: rip it out.

Friday, 29 May 2009

You are using Continuous Integration, aren't you?

This is one of those questions expecting the answer yes, like you have lost your virginity, haven't you?, which has a motivational impact.

Another prod in the right direction was when someone used Hudson as the term for CI server, as you would use Hoover for vaccum cleaner.

I have tried three times to use Continuum, only once with any degree of success. Hudson just works, straight out of the box.

I am proud to say I am, at last and later than most, using Continuous Integration.

Wednesday, 8 April 2009

The map is not the territory

My new job on the Erewhon Project is largely based upon the work of my predecessor Arno Mittelbach.

In a series of posts leading up to the new OxPoints Arno rediscovers the issues around using first order predicate calculus on continuous dimensions such as time.

This would appear to be a rediscovery of the Yale Shooting Problem: the real world cannot be modelled in a monotonic logic. Locations are not points but areas, names are not simple properties but have implicit usage start and end times. Only in maths is something as simple as its description: the map is not the territory.

Friday, 3 April 2009

amd64 "no such file or directory" error with Android and Skype

Using an amd64 debian (lenny and kubuntu jaunty) install I came across the least informative error message yet:

bash: adb: No such file or directory

and similarly for skype.

This appears to be due to not yet having installed the i36 compatibility libraries:
apt-get install ia32-libs
and it goes away.

Wednesday, 1 April 2009

Bye then Pepper. Good girl.


On Wednesday morning, at about 8.15, Pepper died.

Whilst she was rather young (eleven maybe) to die, for a mongrel, her timing was pretty good. It was the first day of my new job and as it was all of us were stroking her as she stopped breathing, twitched and was gone.

Friday, 20 March 2009

Pictures tell of thousands of words

Had to give a presentation for an interview with OUCS on "the challenges of creating mobile location-based services to students" so took a walk and photographed the signage.

Did the presentation in OpenOffice Impress, but of course the fonts were different on Windows and the colours were the first ones I chose not the ones I had settled on and saved and which showed on Apple and Linux.
If I don't get the job I will blame grotty software.

Thursday, 19 March 2009