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

Re: Adding current svn revision to source automatically

From: JeremyP <jeremyp_at_jeremyp.net>
Date: Tue, 16 Dec 2008 12:42:51 +0000

On 15 Dec 2008, at 19:46, Kenneth Goldman wrote:

> "Andy Levy" <andy.levy_at_gmail.com> wrote on 12/15/2008 02:15:27 PM:
>
>
> As I tried to explain above, this requires access to the svn
> repository
> at build time, right? The version never appears in the source,
> right?
> So If I create a source tarball and send it to someone, they can't
> build binaries.
>
What I do is have a target called genversion (in Xcode, but it'll work
if you use make or ant or anything) that creates a .c file and .h file
with the output of svnversion embedded. My binary build includes a
dependency on the genversion build target so that the .c file is
always regenerated.

Then I have another target that creates a source distribution (by
copying all the source files without the .svn directories to another
place and that target also has a dependency on genversion.

It means you can't just svn export your source tree, but once you've
set up the source distribution, it's no less convenient.

At one point I tried putting the generated .c file in the repository,
but that just doesn't work. The act of committing it makes it out of
date.
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=984955

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-16 13:43:55 CET

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.