BuildNumber — from SVN into your application

Finally found some time to publish BuildNumber — a Maven plugin and Ant task to embed SVN build number into your application during build. Great for tracking what version is deployed where.

Advertisements

rsync IDE project files

The jury is still out on whether to version control the IDE files (see for example this question on StackOverflow). I recently tend to agree with Anton and lend towards not version-controlling or at least keeping them separate.

This little rsync script can help moving all project files to a separate hierarchy so that you can manage them separately from your source tree:

#!/bin/sh
rsync -av \
–filter=’+ */’ \
–filter=’+ .classpath’ \
–filter=’+ .project’ \
–filter=’+ **/*.iml’ \
–filter=’+ .idea/***’ \
–filter=’- *’ \
–prune-empty-dirs $1 $2

Thanks Shane Meyers for the insight into rsync filter patterns.

ProGuard, Mac OS X, runtime libraries and honey

ProGuard is a great tool for packaging your Java Applet or application. We use it mainly to package a program and bunch of dependencies into small .jar file. It works great on Linux and Windows but on my Mac it would end up with messages like:

[proguard] Reading library jar [/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/jsse.jar]
[proguard] Error: Can't read [proguard.ClassPathEntry@50502819] (No such file or directory)

With some help  from the Eric Lafortune, the ProGuard author, the solution was to put a link to the missing file to its “regular” place in Java libraries:

cd $JAVA_HOME/lib
sudo ln -s ../../Classes/classes.jar rt.jar
sudo ln -s ../../Classes/jsse.jar .

The downside is that you should do some manual stuff on each Mac you want to build on. If somebody has better solution I would love to know about it.

In military training long time ago, I and my fellow students were forced to do a lot of things that were illogical, redundant or  outright stupid. Sometimes our only explanation was “so the life wouldn’t seem sweet like honey”. It kind of made sense to make life intentionally hard in the army — it was supposed to be training after all. It seems that the Apple in this case was following the same logic: let’s spread runtime libraries all over the system so that the engineer’s life wouldn’t seem too sweet like honey. Anybody got better explanation, please let me know.