Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated Versioning for Git:

- Added make_git_version_header.sh as an alternative to make_svn_version_header.sh. It generates an svn_version.h header with an SVN_VERSION constant, too, for compatibility.
- Added make_git_version_header.sh to project hierarchy so Verpack doesn't overlook it during packaging.
  • Loading branch information...
commit 66457bfa65efc75bfae8906fc6cf4aa725c12f53 1 parent bc827a2
@uliwitness authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 make_git_version_header.sh
View
22 make_git_version_header.sh
@@ -0,0 +1,22 @@
+#
+# Run this file as part of your build process to extract the latest
+# revision from your Git working copy and create a 'svn_version.h'
+# file defining a SVN_VERSION constant to that value.
+#
+# This is for a user-visible build number, so we use the number of revisions
+# and not the actual git hash.
+#
+# The file will be created in the current directory and the subversion
+# revision number is extracted from the current folder's .svn/entries
+# file.
+#
+
+echo -n "note: Finding revision in "
+pwd
+revnum=`/usr/local/git/bin/git rev-list HEAD | /usr/bin/wc -l | sed -e 's/^ *//g;s/ *$//g'`
+fullrevnum=`/usr/local/git/bin/git rev-parse HEAD`
+
+# Now write the constant declaration to the file:
+echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
+echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
+echo "note: Wrote revision $revnum to svn_version.h"
Please sign in to comment.
Something went wrong with that request. Please try again.