summaryrefslogtreecommitdiff
path: root/src/buildstream/_context.py
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-07-17 11:10:52 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-17 11:10:52 +0000
commitc7263e31d8663df2e16576778b596dffe27e924f (patch)
tree18552a6b837d8df1a4ec01a2d043d0a64634890f /src/buildstream/_context.py
parent6160a64cfc4788d9c7e0519b77f55ed870b6a6a7 (diff)
parentdf92e8e08ea4ddfd58d6cfbf63d758cda5d3d44f (diff)
downloadbuildstream-c7263e31d8663df2e16576778b596dffe27e924f.tar.gz
Merge branch 'juerg/platform' into 'master'
Store Platform reference in Context instance variable See merge request BuildStream/buildstream!1480
Diffstat (limited to 'src/buildstream/_context.py')
-rw-r--r--src/buildstream/_context.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index bb9825f44..3c20834b0 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -25,6 +25,7 @@ from . import _yaml
from ._exceptions import LoadError, LoadErrorReason
from ._messenger import Messenger
from ._profile import Topics, PROFILER
+from ._platform import Platform
from ._artifactcache import ArtifactCache
from ._sourcecache import SourceCache
from ._cas import CASCache, CASQuota, CASCacheUsage
@@ -153,6 +154,7 @@ class Context():
self.messenger = Messenger()
# Private variables
+ self._platform = None
self._artifactcache = None
self._sourcecache = None
self._projects = []
@@ -343,6 +345,13 @@ class Context():
'remote-execution'])
@property
+ def platform(self):
+ if not self._platform:
+ self._platform = Platform.create_instance()
+
+ return self._platform
+
+ @property
def artifactcache(self):
if not self._artifactcache:
self._artifactcache = ArtifactCache(self)