A StyleCop plugin for the Bamboo CI server
I've been using Atlassians' Bamboo CI server for quite a while now. While it integrates tightly into all the other great Atlassian products like JIRA, Confluence or Fisheye - I have (had) some grief with it after switching from Hudson:
Bamboo is first and foremost a CI server for Java based projects. While it has been sporting support to build C# / .NET based projects for a while now, it has a lot less plugins for this platform.
Where I work we were avid fans of the Violations plugin for Hudson. It looks for data generated by static code analyzers such as PMD or Checkstyle, parses the files generated by these plugins and provides this information in a nice way on the build server's website. The Violations plugin also supports C#/.NET tools such as StyleCop and FxCop.
Since switching to Bamboo me and my colleagues found it more difficult to keep up our software quality standards which means no StyleCop and no FxCop errors/warnings in our production code! Luckily I could convince the team to make some time for me to develop a Bamboo plugin which parses StyleCop information.
So here it is for you to enjoy: download here
What the plugin does:
1. Look for all files defined by a search pattern, e.g. "\build-reports\**\*StyleCopViolations.xml" would find all xml files ending with StylecopViolations in all sub-directories below the "build-reports" directory.
2. Parse all found files, noting the total number of StyleCop violations
3. Add up all violations, calulate a delta to the last successful build
4. Present the information on a page in Bamboo's web interface on a per-build basis
Throw in some color coding and you can instantly see which VS projects have how many StyleCop violations.
To achieve aforementioned result you will have to configure StyleCop to generate one XML file per VS project. I have added a target file for integrating StyleCop into your build script which does that.
You can call MsBuild from NAnt so that it uses this target file like this:
<msbuild project="${solution.file}" target="ReBuild" verbosity="Quiet">
<property name="Configuration" value="${solution.configuration}" />
<property name="CustomAfterMicrosoftCommonTargets" value="${path::combine(project.base.dir, global.stylecop.target)}"/>
<property name="StyleCopEnabled" value="true" />
</msbuild>
For more information please refer to the wiki page of the StyleCop plugin on BitBucket.org.
A great read for everyone involved with creating software
I just stumbled across this article on the web: The Joel Test: 12 Steps to Better Code. I can't believe it that it is almost 10 years old already!
Having turned around the complete software development process at my current employer during the last year most of these steps came natural to me when I though about what was necessary to create an environment where people can write effective code effectively.
Now that the daily grind has settled in a bit, things look good. Not as stellar as I imagined in the very beginnings but I guess everyone has to accept compromises. Even though I'm happy with the progress we've made - reading the 12 steps again brings back the feeling that although things are going well that we're not yet at the end of this process of renewal.
I'm looking forward to the day when I can answer every single question with 'yes'.
Every person involved in creating software, no matter if programmer, software architect or software development manager should know those 12 steps.
Fast User Switching (FUS) and shared AFP network volumes
I have just recently bought a Synology DiskStation DS209 to serve as a centralized storage for backups, shared files and our music collection.
Since I and my girlfriend share using a trusty old PowerMac G5, we make use of Fast User Switching (FUS) quite a lot. It is a really neat thing - and hey, it's UNIX anyway so why shouldn't we have multiple users being logged in to the same computer at the same time.
Here is the clincher: If you want to use a shared AFP network volume it's all fine and dandy as long as you don't use FUS. Once you use FUS and User1 mounts 'music', it is mounted as '/Volumes/music'. User2 then logs in - but can't access that mounted volume! User2 can now mount that volume again, this time it gets mounted under /Volumes/music-1.
Now this is a major f*ck-up. The reason is quite simple to see. Just take iTunes for example. You want to have a shared iTunes library with all your actual music files residing on the AFP mount? iTunes saves the path to the music files like this: /Volumes/music/albums/... . This means as long as your volume 'music' gets mounted under 'music' no problem - but if the second user decides to mount it as well it won't work anymore!
Here's a discussion in the official Apple support forum regarding the topic. Unfortunately no one has coughed up a working solution so far. Only a crude AppleScript is floating around but I'd like the implementation to be a bit more trustworthy.
I'll keep you posted how this is getting along. I'm still all set for sharing files from a network drive AND using FUS.