[p4] Adding Changelist # of project to .Net Assembly?
Nau, Michael
Michael.Nau at cardinal.com
Thu Oct 19 21:35:12 PDT 2006
I started down that same path a few years ago, and discovered no part of
a AssemblyVersion can be larger than 65534. So we ended up stuffing the
changelist number into the AssemblyDescription attribute.
With regards to how we pull the info, we wrap our build with an nant
script that takes care of calling perforce to figure out the latest
changelist then dynamically updating our AssemblyInfo.cs files at build
time.
-Mike
-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Pavloff, Alex
(IE) @ SONOMAEO
Sent: Thursday, October 19, 2006 6:04 PM
To: perforce-user at perforce.com
Subject: [p4] Adding Changelist # of project to .Net Assembly?
Hi perforce-user,
For our C/C++ project We've added a "p4 changes -m1 $...@$(P4CLIENT)"
step to our makefiles -- and taken the output from that and generated a
.c file from this. This file contains the highest changelist # at the
time of build of the source in the directory.
As long as this was built from checked-in source, it can be used by
testers and what not as a "what I'm testing" #. If you need to rebuild
that particular rev, sync to the changelist #, rebuild, wa-lah.
Now, I'm thinking about trying to do the same thing with a Visual Studio
2005/C# project -- and I believe that the "correct" way to do this would
be to generate generate the AssemblyVersion attribute from the Perforce
changelist #, such that it'd be
[assembly: AssemblyVersion("1.0.0.98776")]
Where 98776 is the Changelist #. Normally this attribute is hardcoded
in the AssemblyInfo.cs file.
Does anyone have any ideas about how to generate this in the Pre-Build
steps for C#/.Net applications?
Thanks!
-Alex
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
_________________________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk - Portuguese - Svenska: www.cardinalhealth.com/legal/email
More information about the perforce-user
mailing list