BuildCount

BuildCount is a simple utility for software developers, used to count builds and include the count information into the program. There are many similar programs. The special feature of this one is Microsoft Visual SourceSafe (VSS) integration. If build count file is in VSS database, the BuildCount can do "check out" operation automatically.

The utility is very simple, and every programmer can write it himself easily. However, I hope somebody may find my implementation useful.

Files Format

BuildCount generates C++ header file (.h) which looks like this:
// 1
#define BUILD_NUMBER 1
#define BUILD_NUMBER_STR "1"
#define BUILD_NUMBER_LOW 1
#define BUILD_NUMBER_HIGH 0
#define BUILD_NUMBER_LOW_STR "1"
#define BUILD_NUMBER_HIGH_STR "0"
On each call it reads build count from the first line, increases it by 1 and rewrites the file with new number. In addition BuildCount can generate .bat file with the following contents:
@SET BUILD_NUMBER=1
The build number in it is always the same as in the .h file.

Command Line Format

BuildCount [/nologo] [/i] [/c] [/n] [file[.h]] [build name] [/b[:batfile[.bat]]]

file.h - header file name. The default is: BuildCount.h
build name - build counter name. The default is: BUILD_NUMBER
/i - interactive mode. If file exists, BuildCount asks user for confirmation.
/b - create .bat file
/c - if the file has "read only" attribute, connect to VSS database and "check it out" (BuildCount finds file location in VSS database automatically)
/n - don't increase build count, but only make "check out" if need, and recreate file.
/nologo - don't print program information

Copyright © 2001-2006 Aleksey Kurzenkov
email: dialserv@pochtamt.ru
Home page: http://www.softmos.com/lyosha/