summaryrefslogtreecommitdiff
path: root/buildstream/_context.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-09-26 09:59:03 +0100
committerJürg Billeter <j@bitron.ch>2018-09-27 10:18:03 +0100
commit7aec8b0f0b205b83a266c4542163394cd34256f5 (patch)
treed5bd0adf7eccf568c1cad4c914454fa07c3d1a51 /buildstream/_context.py
parent10ed9158f0ce91bc18ba4e78f6a44a8595af731e (diff)
downloadbuildstream-7aec8b0f0b205b83a266c4542163394cd34256f5.tar.gz
Move artifact cache creation to Context
The artifact cache is no longer platform-specific.
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r--buildstream/_context.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index 8b8b01b17..cb29968a4 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -30,6 +30,7 @@ from ._exceptions import LoadError, LoadErrorReason, BstError
from ._message import Message, MessageType
from ._profile import Topics, profile_start, profile_end
from ._artifactcache import ArtifactCache
+from ._artifactcache.cascache import CASCache
from ._workspaces import Workspaces
from .plugin import _plugin_lookup
@@ -113,6 +114,7 @@ class Context():
self._cache_key = None
self._message_handler = None
self._message_depth = deque()
+ self._artifactcache = None
self._projects = []
self._project_overrides = {}
self._workspaces = None
@@ -227,6 +229,13 @@ class Context():
"{}: on-error should be one of: {}".format(
provenance, ", ".join(valid_actions)))
+ @property
+ def artifactcache(self):
+ if not self._artifactcache:
+ self._artifactcache = CASCache(self)
+
+ return self._artifactcache
+
# add_project():
#
# Add a project to the context.