9 messages in com.perforce.perforce-user[p4] automatically building in the la...
FromSent OnAttachments
Leo Zelevinsky23 Mar 2005 13:58 
Matthew Janulewicz23 Mar 2005 16:51 
Paul Andrei23 Mar 2005 17:21 
jab23 Mar 2005 17:23 
Douglas Palmer23 Mar 2005 17:52 
Jason Williams23 Mar 2005 19:03 
Grills, Jeff23 Mar 2005 19:13 
Leo Zelevinsky23 Mar 2005 19:16 
Nick Barnes24 Mar 2005 03:07 
Subject:[p4] automatically building in the latest changelist number for a build
From:Paul Andrei (pand@foliage.com)
Date:03/23/2005 05:21:28 PM
List:com.perforce.perforce-user

Our Continuous Build System, after it detects that a change has occurred in one of the monitored branches, does something like this:

1. increments build number 2. runs 'p4 changes -m 1 -s submitted //filespec/...' 3. parses the result and gets the last submitted change number 4. runs 'p4 sync -f //filespec/... at change' 5. builds the project 6. runs unit tests 7. e-mails the interested parties the build results and the actual version (//filespec/... at change)

TIP: it's important for steps 2, 3, and 4 to occur in this order. It's safer to find out what's the last submitted change number first and then fetch *that* version, than to fetch the latest version and then find out what was the last submitted change number. The later suffers from a race condition.

We don't currently embed the change number in the product's version, but it seems like a reasonable idea:

4+. put change number [and build number] in "version.h"

Leo Zelevinsky wrote:

It feels certain that others have run into my design problem before and I don't want to reinvent the wheel.

We have recently moved from SourceSafe to Perforce. Recently, we have decided to adopt the perforce strategy for numbering versions - so that in the version label is built in the latest changelist that was used in making the build.

I am wondering what would be the best way to make this as foolproof as possible. For instance, I'd like our Help/About box to display the latest changelist checked in when this code was last synced. What's the best way to get at that information?

I am thinking that it should be something like a script I run as part of the sync which in addition to the sync would create a .h file with the latest changelist information (I guess gotten via p4 changes -m 1 -s submitted).

Do others do this sort of stuff? Any tips?

Thanks!

_______________________________________________ Come to the 2005 Perforce User Conference, April 14 & 15 in Las Vegas. Learn more: http://www.perforce.com/conf

perforce-user mailing list - perforce-user at perforce.com http://maillist.perforce.com/mailman/listinfo/perforce-user