Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 55 lines (50 sloc) 2.014 kb
66457bf Uli Kusterer Updated Versioning for Git:
authored
1 #
720b0e7 Uli Kusterer 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 Uli Kusterer 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
eff8e4d Uli Kusterer Use the copy of git in Xcode
authored
41 GIT='/Applications/Xcode.app/Contents/Developer/usr/bin/git'
42
66457bf Uli Kusterer Updated Versioning for Git:
authored
43 echo -n "note: Finding revision in "
44 pwd
eff8e4d Uli Kusterer Use the copy of git in Xcode
authored
45 revnum=`$GIT rev-list HEAD | /usr/bin/wc -l | tr -d ' '`
46 fullrevnum=`$GIT rev-parse HEAD`
29823db Uli Kusterer Output from make_git_version.sh is now prettier and includes a build dat...
authored
47 builddate=`date "+%Y-%m-%d"`
66457bf Uli Kusterer Updated Versioning for Git:
authored
48
49 # Now write the constant declaration to the file:
29823db Uli Kusterer Output from make_git_version.sh is now prettier and includes a build dat...
authored
50 echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
51 echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
aef11b9 Uli Kusterer Also output the version number as a number, not just a string, for use i...
authored
52 echo "#define SVN_VERSION_NUM $revnum" >> svn_version.h
29823db Uli Kusterer Output from make_git_version.sh is now prettier and includes a build dat...
authored
53 echo "#define SVN_BUILD_DATE \"$builddate\"" >> svn_version.h
66457bf Uli Kusterer Updated Versioning for Git:
authored
54 echo "note: Wrote revision $revnum to svn_version.h"
Something went wrong with that request. Please try again.