summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/Tools/wix.py4
-rw-r--r--BuildTools/SCons/Version.py16
2 files changed, 12 insertions, 8 deletions
diff --git a/BuildTools/SCons/Tools/wix.py b/BuildTools/SCons/Tools/wix.py
index 69622f6..7b62508 100644
--- a/BuildTools/SCons/Tools/wix.py
+++ b/BuildTools/SCons/Tools/wix.py
@@ -14,37 +14,37 @@ def generate(env) :
env['WIX_LIGHT_OPTIONS'] = '-nologo -ext WixUIExtension'
def WiX_IncludeScanner(source, env, path, arg):
wixIncludeRegexp = re.compile(r'^\s*\<\?include (\S+.wxs)\s*\?\>\S*', re.M)
contents = source.get_contents()
includes = wixIncludeRegexp.findall(contents)
return [ "" + include for include in includes ]
heat_builder = SCons.Builder.Builder(
- action = '"$WIX_HEAT" dir Swift\\QtUI\\Swift -cg Files $WIX_HEAT_OPTIONS -o ${TARGET} -t Swift\\Packaging\\WiX\\include.xslt',
+ action = '"$WIX_HEAT" dir "$WIX_SOURCE_OBJECT_DIR" -cg Files $WIX_HEAT_OPTIONS -o ${TARGET} -t Swift\\Packaging\\WiX\\include.xslt',
suffix = '.wxi')
candle_scanner = env.Scanner(name = 'wixincludefile',
function = WiX_IncludeScanner,
argument = None,
skeys = ['.wxs'])
candle_builder = SCons.Builder.Builder(
action = '"$WIX_CANDLE" $WIX_CANDLE_OPTIONS ${SOURCES} -o ${TARGET}',
src_suffix = '.wxs',
suffix = '.wixobj',
source_scanner = candle_scanner,
src_builder = heat_builder)
light_builder = SCons.Builder.Builder(
- action = '"$WIX_LIGHT" $WIX_LIGHT_OPTIONS -b Swift\\QtUI\\Swift ${SOURCES} -o ${TARGET}',
+ action = '"$WIX_LIGHT" $WIX_LIGHT_OPTIONS -b "$WIX_SOURCE_OBJECT_DIR" ${SOURCES} -o ${TARGET}',
src_suffix = '.wixobj',
src_builder = candle_builder)
env['BUILDERS']['WiX_Heat'] = heat_builder
env['BUILDERS']['WiX_Candle'] = candle_builder
env['BUILDERS']['WiX_Light'] = light_builder
def exists(env) :
return True
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
index 607b6f7..f98a8b9 100644
--- a/BuildTools/SCons/Version.py
+++ b/BuildTools/SCons/Version.py
@@ -1,37 +1,41 @@
import subprocess, os, datetime, re, os.path
-def getGitBuildVersion(project) :
- tag = git("describe --tags --exact --match \"" + project + "-*\"")
+def getGitBuildVersion(root, project) :
+ tag = git("describe --tags --exact --match \"" + project + "-*\"", root)
if tag :
return tag.rstrip()[len(project)+1:]
- tag = git("describe --tags --match \"" + project + "-*\"")
+ tag = git("describe --tags --match \"" + project + "-*\"", root)
if tag :
m = re.match(project + "-(.*)-(.*)-(.*)", tag)
if m :
return m.group(1) + "-dev" + m.group(2)
return None
-def git(cmd) :
- p = subprocess.Popen("git " + cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=(os.name != "nt"))
+def git(cmd, root) :
+ full_cmd = "git " + cmd
+ p = subprocess.Popen(full_cmd, cwd=root, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=(os.name != "nt"))
gitVersion = p.stdout.read()
+ # error = p.stderr.read()
+ # if error:
+ # print "Git error: " + error
p.stdin.close()
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)
+ gitVersion = getGitBuildVersion(root, project)
if gitVersion :
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