Bug 1207882 - Associate an install target with every ContextDerived object. r=gps

Since reading context['FINAL_TARGET'] can have side effects, use it lazily.
This commit is contained in:
Mike Hommey 2015-09-24 10:35:15 +09:00
Родитель a756617866
Коммит 75bdaecdfd
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -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.