This is a complicated one, so I hope I explain it well enough.
Background
I'm in the process of automating a build process with CruiseControl.NET and NAnt. The biggest headache I'm encounting is version number format and CruiseControl.NET requiring the label from a labeller before running a build project.
Currently a developer runs Visual Studio 2008 to produce a Debug, Release and Custom build. Each of these configurations invoke BuildInc (a custom tool) that reads a file (version.ver) increments the read version number, generates an .rc2 file for the executable properties and writes a new version back to version.ver. Obviously version.ver and .rc2 change and need checking backing into source before the developer labels the release in source control. The label in source control is the version number i.e. 1.2.3.4 -> 1-2-3-4.
Currently the new automated build triggers a CruiseControl.NET project that invokes a NAnt script. The NAnt script runs Visual Studio and publishes the builds to a release directory. That works fine, the NAnt script is able to get the previous and new version number by reading version.ver. The problem is getting CruiseControl.NET to label the source and display the label on the dashboard. The new version number/label is generated during the build and which number to increment is held within the Visual Studio project in the pre-link tasks arguments.
Version numbers
Version numbers are in a unique format and are different between builds done on trunk and a development branches. Builds done on a branch are for enhancements that are merged back into trunk when completed.
Trunk
- Format: [Major].[Merge].[Release].00 i.e. 42.01.02.00
- Major: System number
- Merge: Incremented if a branch is merged
- Release: Incremented on bug fixes
Branch
- Format [Major].00.[Stream].[Release] i.e. 42.00.01.01
- Major: System number
- Stream: Stream number, linking it to other components for the enhancement
- Release: Incremented on bug fixes
Numbers are prefixed by zero i.e. 01, 02. This doesn't play well with any tools I'm encountered. (I'm hoping to change that)
Questions
After all that I hope you understand my problems.
- What general improvements could I make to the automated process?
- Do you think the version number should be known before the build is started?
- Should the automate build system auto increment the version number?
- Should I consider changing the version number format?
- Any other comments, I really need more opinions.
Let me know if more information is needed.
Notes
Language is C++, platform is Windows and source control is CVS.