summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-22 21:24:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-22 21:29:00 (GMT)
commita3c9486f2f593220f5a9d4c4e57ac2bc7aa5bbf9 (patch)
tree505a2018aa28ef83828903ddae07a3ddbb07bd8e /BuildTools
parent1fe811468562aaf9cf1583997fb0894c0f56da15 (diff)
downloadswift-contrib-a3c9486f2f593220f5a9d4c4e57ac2bc7aa5bbf9.zip
swift-contrib-a3c9486f2f593220f5a9d4c4e57ac2bc7aa5bbf9.tar.bz2
Fixed SCons not picking up the build version correctly in tarball build.
Diffstat (limited to 'BuildTools')
-rwxr-xr-xBuildTools/GetBuildVersion.py4
-rw-r--r--BuildTools/SCons/Tools/BuildVersion.py2
-rw-r--r--BuildTools/SCons/Version.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/BuildTools/GetBuildVersion.py b/BuildTools/GetBuildVersion.py
index 9d7b29d..a362574 100755
--- a/BuildTools/GetBuildVersion.py
+++ b/BuildTools/GetBuildVersion.py
@@ -2,8 +2,8 @@
import sys
sys.path.append("SCons")
-import Version
+import Version, os.path
assert(len(sys.argv) == 2)
-print Version.getBuildVersion(sys.argv[1])
+print Version.getBuildVersion(os.path.dirname(sys.argv[0] + "/.."), sys.argv[1])
diff --git a/BuildTools/SCons/Tools/BuildVersion.py b/BuildTools/SCons/Tools/BuildVersion.py
index 8b195cd..41e6d8d 100644
--- a/BuildTools/SCons/Tools/BuildVersion.py
+++ b/BuildTools/SCons/Tools/BuildVersion.py
@@ -8,7 +8,7 @@ def generate(env) :
static const char* buildVersion = \"%(buildVersion)s\";\n
#define SWIFT_VERSION_STRING \"%(buildVersion)s\";\n
-""" % { "buildVersion" : Version.getBuildVersion(project) }
+""" % { "buildVersion" : Version.getBuildVersion(env.Dir("#").abspath, project) }
env.WriteVal(target, env.Value(buildVersion))
env.AddMethod(createBuildVersion, "BuildVersion")
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
index 4a2bf77..993536a 100644
--- a/BuildTools/SCons/Version.py
+++ b/BuildTools/SCons/Version.py
@@ -17,12 +17,12 @@ def git(cmd) :
p.stdin.close()
return gitVersion if p.wait() == 0 else None
-def getBuildVersion(project) :
+def getBuildVersion(root, project) :
gitVersion = getGitBuildVersion(project)
if gitVersion :
return gitVersion
else :
- versionFilename = "VERSION." + project
+ versionFilename = os.path.join(root, "VERSION." + project)
if os.path.isfile(versionFilename) :
f = open(versionFilename)
version = f.read().strip()