Thread: Build number
View Single Post
Re: Build number
Old
  (#4)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Build number - 02-08-2004

I made my own program which will increase build number and store date and time of the last build in xml file. It also has history of all builds.

Program also creates .h file, so you can use build number/date/time in your program. It supports multi-project workspace/solution and several configurations (debug/release)

It can be easily implemented in MSVC .NET, because .NET has pre-build setup. So it will launch before compiling, so no problems with time attributes for .h file. You just have to compile it and add this to pre-build line of your program :
$(SolutionDir)buildnum.exe $(SolutionDir)build.xml $(SolutionName) $(ProjectName) $(ConfigurationName) ..\path\to\h\build.h

program is very simple, one .cpp file. Download it here

It is also using my XML parser, so it is good as an example for it.


resulting xml file can look like this :
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<kXBot>
	<kXBotdll>
		<debug>
			<latest>
				<build>4</build>
				<date>02.08.2004</date>
				<time>13:49</time>
			</latest>
			<history>
				<build date="02.08.2004" time="13:49">4</build>
				<build date="01.08.2004" time="11:33">3</build>
				<build date="31.07.2004" time="23:10">2</build>
				<build date="31.07.2004" time="15:14">1</build>
			</history>
		</debug>
		<release>
			<latest>
				<build>2</build>
				<date>02.08.2004</date>
				<time>14:00</time>
			</latest>
			<history>
				<build date="02.08.2004" time="14:00">2</build>
				<build date="01.08.2004" time="10:11">1</build>
			</history>
		</release>
	</kXBotdll>
</kXBot>
and .h file :
Code:
// koraXs build number logger 1.0
// Copyright (c) 2004, Jozef Wagner, http://neuron.tuke.sk/~wagner jowag@szm.sk

// This file is automatically generated, do not edit !

#define BUILD_NUMBER 2
#define BUILD_DATE "02.08.2004"
#define BUILD_TIME "14:00"
btw the code tag in this forum is somewhat broken, it adds one space at the begining, so first line is shifted


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)

Last edited by koraX; 02-08-2004 at 19:21..
  
Reply With Quote