diff options
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r-- | BuildTools/SCons/Version.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py index 57ef96d..a912e02 100644 --- a/BuildTools/SCons/Version.py +++ b/BuildTools/SCons/Version.py @@ -30,3 +30,33 @@ def getBuildVersion(root, project) : return gitVersion return datetime.date.today().strftime("%Y%m%d") + +def convertToWindowsVersion(version) : + version_match = re.match("(\d+)\.(\d+)(.*)", version) + major = int(version_match.group(1)) if version_match else 0 + minor = int(version_match.group(2)) if version_match else 0 + if version_match and len(version_match.group(3)) == 0 : + patch = 99999 + else : + match = re.match("^beta(\d+)(.*)", version_match.group(3)) + build_string = "" + if match : + patch = 1000*int(match.group(1)) + build_string = match.group(2) + else : + match = re.match("^rc(\d+)(.*)", version_match.group(3)) + if match : + patch = 10000*int(rc_match.group(1)) + build_string = match.group(2) + else : + match = re.match("^alpha(.*)", version_match.group(3)) + if match : + build_string = match.group(1) + + if len(build_string) > 0 : + build_match = re.match("^-dev(\d+)", build_string) + if build_match : + patch += int(build_match.group(1)) + + return (major, minor, patch) + |