Bug 1397406 - Don't mark finder as a protected attribute; r?dustin
It seems reasonable to expose this outside of the BuildReader.
MozReview-Commit-ID: 4paDbYl9dEd
--- a/python/mozbuild/mozbuild/frontend/reader.py
+++ b/python/mozbuild/mozbuild/frontend/reader.py
@@ -845,17 +845,17 @@ class BuildReader(object):
"""
def __init__(self, config, finder=default_finder):
self.config = config
self._log = logging.getLogger(__name__)
self._read_files = set()
self._execution_stack = []
- self._finder = finder
+ self.finder = finder
# Finder patterns to ignore when searching for moz.build files.
ignores = {
# Ignore fake moz.build files used for testing moz.build.
'python/mozbuild/mozbuild/test',
# Ignore object directories.
'obj*',
@@ -1109,19 +1109,19 @@ class BuildReader(object):
if mozpath.dirname(relpath) == 'js/src' and \
not config.substs.get('JS_STANDALONE'):
config = ConfigEnvironment.from_config_status(
mozpath.join(topobjdir, reldir, 'config.status'))
config.topobjdir = topobjdir
config.external_source_dir = None
- context = Context(VARIABLES, config, self._finder)
+ context = Context(VARIABLES, config, self.finder)
sandbox = MozbuildSandbox(context, metadata=metadata,
- finder=self._finder)
+ finder=self.finder)
sandbox.exec_file(path)
self._execution_time += time.time() - time_start
self._file_count += len(context.all_paths)
# Yield main context before doing any processing. This gives immediate
# consumers an opportunity to change state before our remaining
# processing is performed.
yield context
@@ -1142,17 +1142,17 @@ class BuildReader(object):
# emitted after their parent, so accumulate the gyp contexts.
# We could emit the parent context before processing gyp
# configuration, but we need to add the gyp objdirs to that context
# first.
from .gyp_reader import GypProcessor
non_unified_sources = set()
for s in gyp_dir.non_unified_sources:
source = SourcePath(context, s)
- if not self._finder.get(source.full_path):
+ if not self.finder.get(source.full_path):
raise SandboxValidationError('Cannot find %s.' % source,
context)
non_unified_sources.add(source)
action_overrides = {}
for action, script in gyp_dir.action_overrides.iteritems():
action_overrides[action] = SourcePath(context, script)
gyp_processor = GypProcessor(context.config,