summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-11-14 08:55:30 (GMT)
committerSwift Review <review@swift.im>2012-11-14 09:54:12 (GMT)
commitc733ee6f86513adf59ead706fc82711c3ca1e1ec (patch)
tree64c7a6a4dbd61123d784bc55d3b3e5f3b9a36fa5 /Swift
parent10c43c39dfd926e7a70ce8a68e33859acf681404 (diff)
downloadswift-c733ee6f86513adf59ead706fc82711c3ca1e1ec.zip
swift-c733ee6f86513adf59ead706fc82711c3ca1e1ec.tar.bz2
Use version numbers for Swift binary so upgrades work
Change-Id: If491b0a62782d568cad132c8c5856aaeb3a3967a
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/SConscript15
-rw-r--r--Swift/resources/Windows/Swift.rc2
2 files changed, 10 insertions, 7 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 5fb238a..c40ba4b 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -164,10 +164,14 @@ sources = [
"QtUISettingConstants.cpp"
]
+# Determine the version
myenv["SWIFT_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift")
-version_match = re.match("(\d+)\.(\d+).*", myenv["SWIFT_VERSION"])
-myenv["SWIFT_VERSION_MAJOR"] = int(version_match.group(1)) if version_match else 0
-myenv["SWIFT_VERSION_MINOR"] = int(version_match.group(2)) if version_match else 0
+if env["PLATFORM"] == "win32" :
+ swift_windows_version = Version.convertToWindowsVersion(myenv["SWIFT_VERSION"])
+ myenv["SWIFT_VERSION_MAJOR"] = swift_windows_version[0]
+ myenv["SWIFT_VERSION_MINOR"] = swift_windows_version[1]
+ myenv["SWIFT_VERSION_PATCH"] = swift_windows_version[2]
+
if env["PLATFORM"] == "win32" :
res_env = myenv.Clone()
@@ -175,6 +179,7 @@ if env["PLATFORM"] == "win32" :
("SWIFT_COPYRIGHT_YEAR", "\"\\\"2010-%s\\\"\"" % str(time.localtime()[0])),
("SWIFT_VERSION_MAJOR", "${SWIFT_VERSION_MAJOR}"),
("SWIFT_VERSION_MINOR", "${SWIFT_VERSION_MINOR}"),
+ ("SWIFT_VERSION_PATCH", "${SWIFT_VERSION_PATCH}"),
])
res = res_env.RES("#/Swift/resources/Windows/Swift.rc")
# For some reason, SCons isn't picking up the dependency correctly
@@ -342,9 +347,7 @@ if env["PLATFORM"] == "win32" :
wixvariables = {
'VCCRTFile': env["vcredist"],
- # FIXME: Not including patch version, but that shouldn't be
- # a problem. It just allows downgrading between development versions
- 'Version': str(myenv["SWIFT_VERSION_MAJOR"]) + "." + str(myenv["SWIFT_VERSION_MINOR"]) + ".0"
+ 'Version': str(myenv["SWIFT_VERSION_MAJOR"]) + "." + str(myenv["SWIFT_VERSION_MINOR"]) + "." + str(myenv["SWIFT_VERSION_PATCH"])
}
wixincludecontent = "<Include>"
for key in wixvariables:
diff --git a/Swift/resources/Windows/Swift.rc b/Swift/resources/Windows/Swift.rc
index eb02bd1..887f389 100644
--- a/Swift/resources/Windows/Swift.rc
+++ b/Swift/resources/Windows/Swift.rc
@@ -1,7 +1,7 @@
#include "Swift/Controllers/BuildVersion.h"
1 VERSIONINFO
- FILEVERSION SWIFT_VERSION_MAJOR, SWIFT_VERSION_MINOR
+ FILEVERSION SWIFT_VERSION_MAJOR, SWIFT_VERSION_MINOR, SWIFT_VERSION_PATCH
// PRODUCTVERSION 1.0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG