[Buildbot-devel] Date of compile in the code

Phil Hannent phil at hannent.co.uk
Tue Sep 2 15:43:20 UTC 2008


Dustin J. Mitchell wrote:
> On Tue, Sep 2, 2008 at 10:28 AM, Phil Hannent <phil at hannent.co.uk> wrote:
>> I want to add the date and time of the compile to the about box of my
>> application which is being built by buildbot.  What way are people adding
>> the date to the builds?
>>
>> Also I would like the source revision as well but one step at a time
>> perhaps.
> 
> These are both things that should be internal to your build process
> (not part of buildbot).  This would be in a setup.py, Makefile, etc.
> Since you didn't specify how your application is built, I can't give
> any more detail.
I am building a Qt application using qmake on win32, linux and mac osx.

I have just been playing around with it and I manage to get a date and time in 
the build by including the following within my .pro file:

win32 {
	DEFINES += BUILDTIME=\\\"$$system('echo %time%')\\\"
	DEFINES += BUILDDATE=\\\"$$system('echo %date%')\\\"
} else {
	DEFINES += BUILDTIME=\\\"$$system(date '+%H:%M.%s')\\\"
	DEFINES += BUILDDATE=\\\"$$system(date '+%d/%m/%y')\\\"
}

However I am not sure how to get the revision from my Monotone repository, I 
read about SourceStamp but could not find a good example of how to do that.

Regards
Phil Hannent

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20080902/43148977/attachment.bin>


More information about the devel mailing list