General

Releasing of a product normally goes through several builds before the final release. For each release, the version number stays the same and the build number gets increased and the verseion control system is tagged using something that is derived from the version number and build number.

In this way, your field testers can associate the bug with the product version number and build numbers.

The implementation of the build number system varies depending on the kind of project.

Apach ANT BuildNumber Task

You can create a target in build file that uses BuildNumber task, and use Ant Driver.

Java Manifest

In Java project, the version number and build number are stored in the manifest file under META-INF/MANIFEST. BuildMaster can read through it and increase the number.

require 'buildmaster'

manifest = BuildMaster::JavaManifest.new(File.join(dir, 'core', 'src', 'META-INF', 'MANIFEST.MF'))

version = manifest.increase_build
puts "version number: #{version.number}"
puts "build number: #{version.build}"

Build Number File

Sometimes a file with just build number would suffice. BuildMaster has a class that can just does that:

require 'buildmaster'

buildnumber = BuildMaster::BuildNumberFile.new(File.join(root, 'lib', 'buildmaster', 'buildnumber'))
buildnumber.increase_build
puts "Build Number is: #{buildnumber.number}"

Document Source (History)