summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-03 22:53:06 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-08 17:03:59 +0900
commitbfcaa37e8fc0970651c64aa4f214b04e4a542725 (patch)
tree9c948e64676e9de331f2e0d6bd779c9245107db3 /buildstream
parent058f8ced73042d28472b3270210d625fa6bc8e10 (diff)
downloadbuildstream-bfcaa37e8fc0970651c64aa4f214b04e4a542725.tar.gz
context.py: Support user specified project options
Constructor now expects cli_options to be specified, and now loading the project overrides supports the 'options' for a given project.
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/context.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/buildstream/context.py b/buildstream/context.py
index 9a745cb7c..d8b3e5b4c 100644
--- a/buildstream/context.py
+++ b/buildstream/context.py
@@ -44,13 +44,11 @@ from ._profile import Topics, profile_start, profile_end
class Context():
- """Context of how BuildStream was invoked
+ """Context()
- Args:
- host_arch (string): The desired architecture on which to run the build
- target_arch (string): The machine on which the results of the build should execute
+ Context of how BuildStream was invoked
"""
- def __init__(self, host_arch, target_arch=None):
+ def __init__(self, cli_options, host_arch, target_arch=None):
self.config_origin = None
"""Filename indicating which configuration file was used, or None for the defaults"""
@@ -127,6 +125,7 @@ class Context():
self._message_depth = deque()
self._platform = None
self._project_overrides = {}
+ self._cli_options = cli_options
def load(self, config=None):
"""Loads the configuration files
@@ -219,7 +218,7 @@ class Context():
# Shallow validation of overrides, parts of buildstream which rely
# on the overrides are expected to validate elsewhere.
for project_name, overrides in _yaml.node_items(self._project_overrides):
- _yaml.node_validate(overrides, ['artifacts'])
+ _yaml.node_validate(overrides, ['artifacts', 'options'])
profile_end(Topics.LOAD_CONTEXT, 'load')