use CmakeLists scope to generate te XML file

- the only difference really is, that scope (the configuration.cmake) is already passed
  to px_process_params via the argument --scope. The Paths in --scope are evaluated w.r.t
  the path to src provided via the -s /--src-path argument.
- if no --scope is proveided. the Old scheme by simply walking the full --src-path directory
  is applied
This commit is contained in:
mazahner
2017-01-04 09:29:52 +01:00
committed by Lorenz Meier
parent c72de874d6
commit 6fe9b8e543
9 changed files with 130 additions and 94 deletions
+14 -12
View File
@@ -1,6 +1,7 @@
import os
import re
import codecs
import sys
class SourceScanner(object):
"""
@@ -8,24 +9,25 @@ class SourceScanner(object):
to the Parser.
"""
def ScanDir(self, srcdir, parser):
def ScanDir(self, srcdirs, parser):
"""
Scans provided path and passes all found contents to the parser using
parser.Parse method.
"""
extensions1 = tuple([".h"])
extensions2 = tuple([".cpp", ".c"])
for dirname, dirnames, filenames in os.walk(srcdir):
for filename in filenames:
if filename.endswith(extensions1):
path = os.path.join(dirname, filename)
if not self.ScanFile(path, parser):
return False
for filename in filenames:
if filename.endswith(extensions2):
path = os.path.join(dirname, filename)
if not self.ScanFile(path, parser):
return False
for srcdir in srcdirs:
for dirname, dirnames, filenames in os.walk(srcdir):
for filename in filenames:
if filename.endswith(extensions1):
path = os.path.join(dirname, filename)
if not self.ScanFile(path, parser):
return False
for filename in filenames:
if filename.endswith(extensions2):
path = os.path.join(dirname, filename)
if not self.ScanFile(path, parser):
return False
return True
def ScanFile(self, path, parser):