summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-20 18:09:14 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-20 18:30:56 (GMT)
commitd35f132d31241e7c2f09b4b2588a02c8a6ae249c (patch)
tree186b78d916f54bb0acc0086de89945ece46317c4 /BuildTools/SCons
parentd6f336ace41ffb29ba0b3477b156dbb55a877bc6 (diff)
downloadswift-contrib-d35f132d31241e7c2f09b4b2588a02c8a6ae249c.zip
swift-contrib-d35f132d31241e7c2f09b4b2588a02c8a6ae249c.tar.bz2
Prioritize version files over git version.
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/Version.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
index 993536a..57ef96d 100644
--- a/BuildTools/SCons/Version.py
+++ b/BuildTools/SCons/Version.py
@@ -18,16 +18,15 @@ def git(cmd) :
return gitVersion if p.wait() == 0 else None
def getBuildVersion(root, project) :
+ versionFilename = os.path.join(root, "VERSION." + project)
+ if os.path.isfile(versionFilename) :
+ f = open(versionFilename)
+ version = f.read().strip()
+ f.close()
+ return version
+
gitVersion = getGitBuildVersion(project)
if gitVersion :
return gitVersion
- else :
- versionFilename = os.path.join(root, "VERSION." + project)
- if os.path.isfile(versionFilename) :
- f = open(versionFilename)
- version = f.read().strip()
- f.close()
- return version
- else :
- # TODO: Add the current branch
- return datetime.date.today().strftime("%Y%m%d")
+
+ return datetime.date.today().strftime("%Y%m%d")