summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/Version.py12
-rw-r--r--Limber/SConscript1
2 files changed, 10 insertions, 3 deletions
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
index 9c690e5..091d998 100644
--- a/BuildTools/SCons/Version.py
+++ b/BuildTools/SCons/Version.py
@@ -5,9 +5,15 @@ def getGitBuildVersion(project) :
if tag :
return tag.rstrip()[len(project)+1:]
tag = git("describe --tags --match \"" + project + "-*\"")
- m = re.match(project + "-(.*)-(.*)-(.*)", tag)
- if m :
- return m.group(1) + "-dev" + m.group(2)
+ if tag :
+ m = re.match(project + "-(.*)-(.*)-(.*)", tag)
+ if m :
+ return m.group(1) + "-dev" + m.group(2)
+ log = git("log --oneline")
+ if log :
+ return project + "-0.1-dev" + str(len(log.split("\n")))
+ else :
+ return project + "-0.0-dev"
def git(cmd) :
p = subprocess.Popen("git " + cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=(os.name != "nt"))
diff --git a/Limber/SConscript b/Limber/SConscript
index e766f97..c81f1f8 100644
--- a/Limber/SConscript
+++ b/Limber/SConscript
@@ -2,6 +2,7 @@ Import("env")
if env["SCONS_STAGE"] == "build" :
myenv = env.Clone()
+ myenv.BuildVersion("BuildVersion.h", project = "limber")
myenv.MergeFlags(env["SWIFTEN_FLAGS"])
myenv.MergeFlags(env["LIBIDN_FLAGS"])
myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))