Commit 90373b8e authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Joerg Bornemann

Make share.qbs generator work on Windows

Change-Id: I2b8718d225cf6cc3c0249237e6486253b03949dd
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@nokia.com>
parent 07f10a02
#!/usr/bin/env python2.7 #!/usr/bin/env python
# #
# Script for automatically updating share.qbs # Script for automatically updating share.qbs
# Usage: Just call it without arguments. # Usage: Just call it without arguments.
# #
import os, os.path import os
import posixpath as path
import inspect import inspect
scriptFileName = os.path.basename(inspect.getfile(inspect.currentframe())) scriptFileName = path.basename(inspect.getfile(inspect.currentframe()))
shareDirPath = os.path.dirname(inspect.getfile(inspect.currentframe())) shareDirPath = path.dirname(inspect.getfile(inspect.currentframe()))
print "updating " + shareDirPath + "/share.qbs" print "updating " + shareDirPath + "/share.qbs"
os.chdir(shareDirPath) os.chdir(shareDirPath)
...@@ -51,6 +52,7 @@ for root, dirs, files in os.walk("."): ...@@ -51,6 +52,7 @@ for root, dirs, files in os.walk("."):
dirs.remove('.obj') dirs.remove('.obj')
except: pass except: pass
root = root.replace('\\', '/')
for file in files: for file in files:
if not (file in blacklist): if not (file in blacklist):
if not root in filenamedict: if not root in filenamedict:
...@@ -59,12 +61,12 @@ for root, dirs, files in os.walk("."): ...@@ -59,12 +61,12 @@ for root, dirs, files in os.walk("."):
filenamedict[root].append(file) filenamedict[root].append(file)
for directory in sorted(filenamedict.iterkeys()): for directory in sorted(filenamedict.iterkeys()):
prefix = directory prefix = directory.replace('\\', '/')
if prefix.startswith("./"): if prefix.startswith("./"):
prefix = os.path.normpath(prefix[2:]) prefix = path.normpath(prefix[2:])
if not prefix.endswith("/"): if not prefix.endswith("/"):
prefix += "/" prefix += "/"
normalizedDirectory = os.path.normpath(directory) normalizedDirectory = path.normpath(directory.replace('\\', '/'))
writeln("") writeln("")
writeln(" Group {") writeln(" Group {")
writeln(" qbs.installDir: \"share/" + normalizedDirectory + "\"") writeln(" qbs.installDir: \"share/" + normalizedDirectory + "\"")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment