As most of you who have read any of my post before will know I abhor having to perform repetitive tasks (this probably explains my lack of enthusiasm in going for a run each day :p). Anyway, a long standing peeve of mine is the hassle you have to go through every time you want to create a Flex project that utilizes the Cairngorm framework (and probably any framework come to think of it). It’s not necessarily the class creation but the initial set up that really gets me.
There are quite a few folders to create and most of us would prefer to get it out of the way at start up. Couple this with the fact that the Cairngorm.swc needs to be linked in as well and you are getting on to wasting maybe 5 whole minutes!!1 :p. And those are five minutes I’d rather be actually coding :). To take the sting out of this and make it a little easier for us to include additional SWC files quickly and easily. Adobe provided us with the ‘libs’ directory in Flex Builder 3. However I still have to remember to import the Cairngorm SWC in to this folder and as it’s on a per project basis I have to do it EVERY TIME.
To that end and to allow me to get working ASAP I put together a little set of ANT scripts that create the directory structure for me (slightly tweaked for my own way of working) and included a couple of tasks that will download unzip and copy the Cairngorm SWC in to my ‘libs’ directory. I’ve removed my tweaked structure and replaced it with the “standard” Cairngorm set up but feel free to alter it for your needs.
So if you want to save yourself a few minutes hassle setting up your Cairngorm projects you are welcome to grab the script and try it out. You can download it below. This has been tested on an eclipse installation using the Flex Builder plugin. However it should operate perfectly fine in a standalone version of Flex Builder (once you add the Java Development Tools plugin to enable ANT).
As with everything. Use it at your own risk. It’s not my fault if this file steals all of your cash and drinks your beer (or breaks something).
Download Cairngorm Ant tasks