[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 Subvers ion)

From: Mark Phippard <MarkP_at_softlanding.com>
Date: 2004-08-09 16:45:49 CEST

"Wadsworth, Eric (Contractor)" <wadswore@fhu.disa.mil> wrote on 08/09/2004
10:38:24 AM:

> > > 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?

The "svnversion" command can be used to print out the current version. I
have seen examples of scripts go by on this list which did some magic with
pipes to construct a source file on the fly with the information embedded
appropriately.

Actually, the TortoiseSVN site contains with a command line utility that
will do this for you. It is called SubWCRev.exe. This is how they
describe it:

"SubWCRev.exe: a small command line tool which you can use in your build
steps. It takes a file as an argument and replaces all "$WCREV$" strings
with the revision of your working copy. This is useful if you want to
include the Subversion revision in the version of your project. If you
need an example, check out the TortoiseSVN source."

http://tortoisesvn.tigris.org/download.html

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 9 16:46:24 2004

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