summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/SCons/Version.py')
-rw-r--r--BuildTools/SCons/Version.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
new file mode 100644
index 0000000..c707942
--- /dev/null
+++ b/BuildTools/SCons/Version.py
@@ -0,0 +1,10 @@
+import subprocess
+
+def getGitBuildVersion() :
+ p = subprocess.Popen("git rev-parse HEAD", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
+ return p.stdout.read().rstrip()[0:7]
+
+def getBuildVersion(version = None) :
+ if version :
+ return version
+ return getGitBuildVersion()