summaryrefslogtreecommitdiff
path: root/buildstream/_project.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-10-18 10:52:50 +0200
committerJürg Billeter <j@bitron.ch>2018-02-08 14:04:38 +0100
commit399f09b74c0014066fbb32c3a7db84e5b4ef51e5 (patch)
tree0c671d0201ab2ddd663807ce8815bccdc621ed4f /buildstream/_project.py
parent82913c77409478dccf7797c631bb6bc1f5f57aa2 (diff)
downloadbuildstream-399f09b74c0014066fbb32c3a7db84e5b4ef51e5.tar.gz
Add junction support for subprojects
This introduces junctions as a new kind of elements to allow dependencies to cross project boundaries.
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r--buildstream/_project.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index b913ff24d..992dd6274 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -51,7 +51,7 @@ _ALIAS_SEPARATOR = ':'
#
class Project():
- def __init__(self, directory, context, *, cli_options=None):
+ def __init__(self, directory, context, *, junction=None, cli_options=None):
# The project name
self.name = None
@@ -71,6 +71,7 @@ class Project():
self._plugin_source_origins = [] # Origins of custom sources
self._plugin_element_origins = [] # Origins of custom elements
self._options = None # Project options, the OptionPool
+ self._junction = junction # The junction element, if this is a subproject
self._cli_options = cli_options
self._cache_key = None
self._source_format_versions = {}
@@ -147,6 +148,9 @@ class Project():
options_node = _yaml.node_get(config, Mapping, 'options', default_value={})
self._options = OptionPool(self.element_path)
self._options.load(options_node)
+ if self._junction:
+ # load before user configuration
+ self._options.load_yaml_values(self._junction.options, transform=self._junction._subst_string)
# Collect option values specified in the user configuration
overrides = self._context._get_overrides(self.name)