info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Automatically increment build number


From: Weber, Mathias-Henry 1254 PPW-P1
Subject: RE: Automatically increment build number
Date: Wed, 9 May 2001 17:14:56 +0200

> -----Original Message-----
> From: Todd Denniston [mailto:address@hidden
> Sent: Wednesday, 9. May 2001 16:42
> To: Weber, Mathias-Henry 1254 PPW-P1
> Cc: address@hidden
> Subject: Re: Automatically increment build number
> 
> 
> "Weber, Mathias-Henry 1254 PPW-P1" wrote:
> > 
> <SNIP>
> > 
> > 
> 
> Sorry to reopen but I could not help but to believe the 
> restated problem
> (tracking where something is in one day / builder) as a 
> little easier to
> solve.
> 
> 1. have your "official" test release tag script apply 
> appropriate strings for
> an "official" release.
> 2. have another tag script set the development baseline up 
> with a line like
> the following:
> fprintf(stderr, "\n \t compiled %s %s\n", __DATE__ , __TIME__ );
> 
> It should also be possible to some how pass in the username 
> (on unix anyway)
> as a -D option to the compiler and add that to the line.
> 

See how my central version info class looks like:

===========CODE=====================
cVersionInfo::cVersionInfo(const char* fApplicationName)
    : m_ApplicationName (fApplicationName)
{
#include "VersionInfoText.cpp"
#include "BuildInfoText.cpp"
#include "VersionInfoTextLocal.cpp"

    m_BuildDate   = __DATE__;
    m_BuildTime   = __TIME__;

};
===========CODE=====================

There is a "Print" method reporting these variables. The included text files
look like:


===========VersionInfoTextLocal.cpp=====================
m_BuildUser = "Mathias-H. Weber";
m_BuildHost = "WeberM-NT";
===========VersionInfoTextLocal.cpp=====================

===========VersionInfoText.cpp===========
m_VersionString = "QS-DSI-Alpha2.4";
m_VersionInfoText = "Beta Candidate 1";
===========VersionInfoText.cpp===========

===========BuildInfoText.cpp===========
m_BuildString = "48";
===========BuildInfoText.cpp===========

The file VersionInfoTextLocal.cpp is never checked in and specific for every
developer. The file BuildInfoText.cpp is the one that is checked out on
every commit and the number is increased by one. The file
VersionInfoText.cpp gives the tag for the "official" release.

Just having __TIME__ in a file is not sufficient. This file must be rebuild
every once the resulting executable is linked. So you need an additional
rule for this file.

Cheers
Mathias



reply via email to

[Prev in Thread] Current Thread [Next in Thread]