summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-23 20:19:31 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-25 00:20:14 +0900
commit89f280867dcf012d08d97a6911d912865e99f912 (patch)
tree70f87416ee568388ea1a84c50170fa20ad18dc61
parentf6ceefbb3dabc11b34c6b380925eaecccfa99060 (diff)
downloadbuildstream-89f280867dcf012d08d97a6911d912865e99f912.tar.gz
_context.py: Added _get_toplevel_project() convenience accessor
-rw-r--r--buildstream/_context.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index 9801f54c4..725a9c31c 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -228,6 +228,17 @@ class Context():
def _get_projects(self):
return self._projects
+ # _get_toplevel_project():
+ #
+ # Return the toplevel project, the one which BuildStream was
+ # invoked with as opposed to a junctioned subproject.
+ #
+ # Returns:
+ # (list): The list of projects
+ #
+ def _get_toplevel_project(self):
+ return self._projects[0]
+
# _get_overrides():
#
# Fetch the override dictionary for the active project. This returns