Bug 1215526 - part 3 - make preprocessor.preprocessor report all included files; r=glandium
authorNathan Froyd <froydnj@mozilla.com>
Wed, 21 Oct 2015 10:38:18 -0400
changeset 304567 b77130c95e52af0831b33c63557f4564414d3018
parent 304566 936491b643506f1c5abc0bd8cc6fecfa9c11da8d
child 304568 41913aea0fb03d236ecff025467b2e64e263842f
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1215526
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1215526 - part 3 - make preprocessor.preprocessor report all included files; r=glandium For GENERATED_FILES scripts that want to report dependencies, this change makes it easy to use |preprocess|, rather than having to construct and use |Preprocessor| manually.
python/mozbuild/mozbuild/preprocessor.py
--- a/python/mozbuild/mozbuild/preprocessor.py
+++ b/python/mozbuild/mozbuild/preprocessor.py
@@ -780,14 +780,15 @@ class Preprocessor:
 def preprocess(includes=[sys.stdin], defines={},
                output = sys.stdout,
                marker='#'):
     pp = Preprocessor(defines=defines,
                       marker=marker)
     for f in includes:
         with open(f, 'rU') as input:
             pp.processFile(input=input, output=output)
+    return pp.includes
 
 
 # Keep this module independently executable.
 if __name__ == "__main__":
     pp = Preprocessor()
     pp.handleCommandLine(None, True)