Bug 1219521 - Add imported python modules in the tree to dependencies of GENERATED_FILES scripts. r=glandium

This commit is contained in:
Chris Manchester 2015-11-16 16:51:51 -08:00
parent cace689ddb
commit 0953a7e528

View File

@ -14,8 +14,11 @@ import os
import sys
import traceback
from mozbuild.util import FileAvoidWrite
from mozbuild.pythonutil import iter_modules_in_path
from mozbuild.makeutil import Makefile
from mozbuild.util import FileAvoidWrite
import buildconfig
def main(argv):
parser = argparse.ArgumentParser('Generate a file from a Python script',
@ -61,6 +64,8 @@ def main(argv):
# is an error (so scripts can conveniently |return 1| or
# similar).
if isinstance(ret, set) and ret:
ret |= set(iter_modules_in_path(buildconfig.topsrcdir,
buildconfig.topobjdir))
mk = Makefile()
mk.create_rule([args.output_file]).add_dependencies(ret)
with FileAvoidWrite(args.dep_file) as dep_file: