Monthly Archives: December 2008

You are a tool if you aren’t using Gant

If you are still writing your build scripts in XML then you my friend are a tool (the slang associated with the word “tool” is also implied :p). You are doing far too much heavy lifting and wasting everybody’s time and money by maintaining your build scripts in XML.

My recommendation is to use a build tool like Gant, which is a groovy based build tool that wraps Ant tasks and more. All you need is the standalone version of Gant, which includes all dependencies (eg groovy, ivy, maven, etc). You’ll need to use at least version 1.4, as there is a bug with 1.3 that prevents you from using the Ivy tool set.

The following is a simple Gant script that shows you how to manage your project’s dependencies using Gant’s Ivy integration. The script creates a lib directory and two sub-directories. The sub-directories will contain Jars for the application and for testing respectively. The script depends on having internet access, as the Jars will be downloaded from a public repositiory (ibiblio) and stored in your local repository. Your local repository acts as a cache, so you don’t have to keep downloading the dependencies every time you run your build script in a continuous integration system like Cruise.

libDirectory = 'lib'

includeTargets << gant.targets.Clean
cleanDirectory << libDirectory
cleanPattern << [ '**/*~' , '**/*.bak' ]

includeTool << gant.tools.Ivy

target ( retrieveDependencies : 'Retrieves library dependencies for main and test.' ) {
    depends ( clean )
    mkdir ( dir : libDirectory )
    ivy.retrieve ( organisation : 'commons-lang' , module : 'commons-lang' , revision : '2.3' , inline : 'true', pattern : libDirectory + '/main/[artifact]-[revision].[ext]' )
    ivy.retrieve ( organisation : 'junit', module : 'junit', revision : '4.5', inline : 'true', pattern : libDirectory + '/test/[artifact]-[revision].[ext]')
}

setDefaultTarget ( retrieveDependencies )

Execute the build.gant script using Gant and you will observe the Jars being downloaded and copied to the main and test directories. If you run the script again the Jars will be copied to the lib directory from your local Ivy repository (on Ubuntu this is .ivy2). The end result is the following directory structure.

build.gant
lib
    main
        commons-lang-2.3.jar
    test
        junit-4.5.jar

The equivalent script in XML will probably take ten times more effort, especially if you have to maintain your Ivy files in XML as well! Your build scripts in Gant look less cluttered and more readable than your typical XML based Ant scripts, which will make maintaining your build scripts far less painful. Plus you have the power of Groovy at your disposal for handling more complicated logic. So don’t be a tool when it comes to builds. Use Gant for your build tool.

Bring sexy back to IT… wear a tie

I am an IT professional and it has become the status quo to not wear a tie. In fact the fashion status quo in IT is a t-shirt sporting a geeky statement like “I see dead pixels” or the molecular representation of caffeine, with shorts and sandals to boot. You are all nodding your heads because you know what I am talking about.

Anyway if you want to stand out then simply wear a tie. I wore a tie to work today and I attracted far too much attention. Wear a tie and people instantly start wondering if you are going to a job interview during lunch. Maybe I am, maybe I’m not… I like to keep people on their toes. ;-)

So why did I wake up this morning to put a tie on with a Windsor knot? Maybe it has something to do with the marathon of James Bond 007 films that I’ve been subjected to recently. If James Bond can run through walls in a suit and tie, then surely I can code up a storm in the same attire.

I also had an epiphany that as a developer I am alienating myself from the business by not wearing what they wear. From a superficial level I am making a statement that I am different from them when I present myself differently. There has been a lot of research on this very topic and it is usually referred to as impression management. Impression management is a field in psychology that focuses on the idea that perception translates into reality. In the social and psychological sense your first impression sets expectations as to how others will be able to interact with you.

It hardly sounds fair, but people are superficial, mostly from necessity in dealing with information overload on a daily basis. These days people are too time-poor to get to know you on a personal level so they pigeon-hole you based on appearances. If you portray the stereotype of a geek, then you will be perceived to be a geek. Wear a suit, and you will be perceived as someone that the business can deal with. Become a sheep in wolf’s clothing.

If you find yourself whinging about the business not showing up to standups or iteration planning meetings then maybe you should try something different and radical, like wear a tie. If you think a small gesture like wearing a tie will not make an impact then you will be surprised. Show up to work tomorrow with a tie if you don’t believe me, in fact I dare you.

Do I feel different or uncomfortable wearing a tie? No, not really, except for the desire to drink a dry martini… shaken not stirred.