summaryrefslogtreecommitdiff
path: root/buildstream/_context.py
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-05-07 19:02:06 +0200
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-06-08 21:07:22 +0000
commit130bfbb84e0de2c2289b9dd708b3f79682d140f4 (patch)
tree18ba1a0f4d81d2a557c6d54e918ba47dffa6715e /buildstream/_context.py
parentccec163b06193b3c21ab0d571d76b72856f0ea55 (diff)
downloadbuildstream-130bfbb84e0de2c2289b9dd708b3f79682d140f4.tar.gz
Handle cross junction elements in workspaces.
Workspaces are now index by colon separated junction path. This now allows to create workspaces for elements in external projects. Workspaces are owned by context instead of root project. However it is initialized once top-level project is registered as we need to resolve paths relatively to this top-level project. Part of #359.
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r--buildstream/_context.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index c0d49b245..114ac9e86 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 ._workspaces import Workspaces
# Context()
@@ -113,6 +114,7 @@ class Context():
self._message_depth = deque()
self._projects = []
self._project_overrides = {}
+ self._workspaces = None
# load()
#
@@ -219,6 +221,8 @@ class Context():
# project (Project): The project to add
#
def add_project(self, project):
+ if not self._projects:
+ self._workspaces = Workspaces(project)
self._projects.append(project)
# get_projects():
@@ -242,6 +246,9 @@ class Context():
def get_toplevel_project(self):
return self._projects[0]
+ def get_workspaces(self):
+ return self._workspaces
+
# get_overrides():
#
# Fetch the override dictionary for the active project. This returns