[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Build number into code? (was: Development practices using Subversion)

From: Don Vawter <donnie_at_vawter.com>
Date: 2004-08-09 20:50:03 CEST

I run this prior to a build.
It copies the highest revision number into a properties file
Of course it depends on the existence of awk and backtick command
substitution.
If you use Ant there is probably a way to do this more efficiently

echo "svnversion=`svn list -Rv <working copy root>/ |awk '{ if($1 > max)
max=$1}END{print(max)}'`" > <desitnation
directory>/currentversion.properties

The resultant currentversion.properties has:
svnversion=xxx

Max Bowsher wrote:

>Wadsworth, Eric (Contractor) wrote:
>
>
>>>>Another question is how to get the release number into the application's
>>>>about box automatically. What we would like to do is use the tag/label
>>>>as the release number. Using the example above if a user brought up the
>>>>about box it would say "Release 1.2". Is there a way to force this
>>>>tag/label into a 'version.h' file when it is checked out?
>>>>
>>>>
>>>I do not think there are any good ways to get a release
>>>number placed in
>>>your source code. It is possible to get the global revision
>>>number, which
>>>can be used as a good build ID. But, to have a user-friendly
>>>value like
>>>"Release 1.2" you would either just have to key it into a file on the
>>>branch, or perhaps do some kind of scripting where you parse
>>>it from the
>>>branch folder name.
>>>
>>>
>>It would be very handy for us to have the revision number automatically
>>dropped into a file every time an update is performed. I'd then make a
>>custom build step that would squash the revision number into a little
>>
>>
>.java
>
>
>>file, which would be built into the product.
>>
>>We're using TortoiseSVN on the workstations. Is there a good way to do
>>
>>
>this?
>
>http://subversion.tigris.org/project_faq.html#version-value-in-source
>
>svnversion is the command line way of doing this.
>
>I think Tortoise has a similar tool.
>
>Max.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
>

-- 
Don
Lyra ('tiel), Boomer ('tiel), Ginger (SIE), Mona Lisa (BFA) Zebra Finch Flock
http://www.vawter.com/index.cfm?fuseaction=pets.showimage&image_id=2971&galleryaction=pets.gallery
www.parrotcams.com www.vawter.com www.dailycryptogram.com www.e-crypto.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 9 20:50:30 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.