Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 53 lines (49 sloc) 2.005 kb
66457bf @uliwitness Updated Versioning for Git:
authored
1 #
720b0e7 @uliwitness Added licensing information to the source files.
authored
2 # make_git_version_header.sh
3 # TalkingMoose
4 #
5 # Created by Uli Kusterer on 2010-02-14
6 # Copyright 2010 Uli Kusterer.
7 #
8 # This software is provided 'as-is', without any express or implied
9 # warranty. In no event will the authors be held liable for any damages
10 # arising from the use of this software.
11 #
12 # Permission is granted to anyone to use this software for any purpose,
13 # including commercial applications, and to alter it and redistribute it
14 # freely, subject to the following restrictions:
15 #
16 # 1. The origin of this software must not be misrepresented; you must not
17 # claim that you wrote the original software. If you use this software
18 # in a product, an acknowledgment in the product documentation would be
19 # appreciated but is not required.
20 #
21 # 2. Altered source versions must be plainly marked as such, and must not be
22 # misrepresented as being the original software.
23 #
24 # 3. This notice may not be removed or altered from any source
25 # distribution.
26 #
27
28 #
66457bf @uliwitness Updated Versioning for Git:
authored
29 # Run this file as part of your build process to extract the latest
30 # revision from your Git working copy and create a 'svn_version.h'
31 # file defining a SVN_VERSION constant to that value.
32 #
33 # This is for a user-visible build number, so we use the number of revisions
34 # and not the actual git hash.
35 #
36 # The file will be created in the current directory and the subversion
37 # revision number is extracted from the current folder's .svn/entries
38 # file.
39 #
40
41 echo -n "note: Finding revision in "
42 pwd
43 revnum=`/usr/local/git/bin/git rev-list HEAD | /usr/bin/wc -l | sed -e 's/^ *//g;s/ *$//g'`
44 fullrevnum=`/usr/local/git/bin/git rev-parse HEAD`
29823db @uliwitness Output from make_git_version.sh is now prettier and includes a build dat...
authored
45 builddate=`date "+%Y-%m-%d"`
66457bf @uliwitness Updated Versioning for Git:
authored
46
47 # Now write the constant declaration to the file:
29823db @uliwitness Output from make_git_version.sh is now prettier and includes a build dat...
authored
48 echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
49 echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
aef11b9 @uliwitness Also output the version number as a number, not just a string, for use i...
authored
50 echo "#define SVN_VERSION_NUM $revnum" >> svn_version.h
29823db @uliwitness Output from make_git_version.sh is now prettier and includes a build dat...
authored
51 echo "#define SVN_BUILD_DATE \"$builddate\"" >> svn_version.h
66457bf @uliwitness Updated Versioning for Git:
authored
52 echo "note: Wrote revision $revnum to svn_version.h"
Something went wrong with that request. Please try again.