From 75bdaecdfd94a56eae0b9df2210fbc5fc09709c2 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 24 Sep 2015 10:35:15 +0900 Subject: [PATCH] Bug 1207882 - Associate an install target with every ContextDerived object. r=gps Since reading context['FINAL_TARGET'] can have side effects, use it lazily. --- python/mozbuild/mozbuild/frontend/data.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py index 84097e34be59..1448b76bb898 100644 --- a/python/mozbuild/mozbuild/frontend/data.py +++ b/python/mozbuild/mozbuild/frontend/data.py @@ -88,6 +88,12 @@ class ContextDerived(TreeMetadata): self.config = context.config + self._context = context + + @property + def install_target(self): + return self._context['FINAL_TARGET'] + @property def relobjdir(self): return mozpath.relpath(self.objdir, self.topobjdir) @@ -163,7 +169,6 @@ class XPIDLFile(ContextDerived): __slots__ = ( 'add_to_manifest', 'basename', - 'install_target', 'source_path', ) @@ -175,8 +180,6 @@ class XPIDLFile(ContextDerived): self.module = module self.add_to_manifest = add_to_manifest - self.install_target = context['FINAL_TARGET'] - class BaseDefines(ContextDerived): """Context derived container object for DEFINES/HOST_DEFINES, which are OrderedDicts.