Creating your own code swarm

This is a little guide on how you can create your own code swarm. Code swarm shows the history of commits in a software project. The visualization looks something like this:

Code swarm

For this guide I'll use SVN, but code swarm supports HG and Git as well (and if you are using something exotic, it isn't that hard to build custom converters). I am doing this on Ubuntu, but it should work on Windows/Mac as well (code swarm is implemented in Java).

1) SVN checkout code swarm

$ svn checkout http://codeswarm.googlecode.com/svn/trunk/ codeswarm-read-only

2) Create a log of your repository

$ svn log -v > my_project.log

3) Convert log to uniform XML format

$ cd codeswarm-read-only
$ python convert_logs/convert_logs.py -s #../my_project.log -o data/my_project.xml

4) Edit data/sample_config.config

Replace:

InputFile=data/sample-repevents.xml

with:

InputFile=data/my_project.xml

and replace:

TakeSnapshots=false

with:

TakeSnapshots=true

5) Create frames and generate snapshots

$ mkdir frames
$ ./run.sh

6) Generate AVI file

$ sudo apt-get install mencoder
$ cd frames
$ mencoder "mf://*.png" -mf fps=10 -o test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=500

7) More on generating videos

How to generate AVI file with sound or generate Flash video, here are some articles from a quick Google search:

An example

Here is Plurk's code swarm:


code_swarm - Plurk from amir salihefendic on Vimeo.

25. Sep 2008 Code · Interesting · Stuff
© Amir Salihefendic