summaryrefslogtreecommitdiff
path: root/buildstream/_project.py
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-02-05 16:54:49 +0000
committerJürg Billeter <j@bitron.ch>2018-02-19 15:17:01 +0000
commit445372c4691f8ac020bc06d61f47ca4123f2c6f7 (patch)
treef6424aabac645c8cc61df0b43f9f098140157ae4 /buildstream/_project.py
parentc81776249ac245ba0cea57de3fa5f625e57ee918 (diff)
downloadbuildstream-445372c4691f8ac020bc06d61f47ca4123f2c6f7.tar.gz
Add a 'sources' field to project.conf to override defaults
Equivalent to the 'elements' field, but slightly different because sources don't have accompanying yaml.
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r--buildstream/_project.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 6ff44b0a2..cb19b55e3 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -66,6 +66,7 @@ class Project():
self._variables = {} # The default variables overridden with project wide overrides
self._environment = {} # The base sandbox environment
self._elements = {} # Element specific configurations
+ self._sources = {} # Source specific configurations
self._aliases = {} # Aliases dictionary
self._workspaces = {} # Workspaces
self._plugin_source_origins = [] # Origins of custom sources
@@ -123,10 +124,13 @@ class Project():
project_conf = _yaml.load(projectfile)
_yaml.composite(config, project_conf)
- # Element type configurations will be composited later onto element types,
- # so we delete it from here and run our final assertion after.
+ # Element and Source type configurations will be composited later onto
+ # element/source types, so we delete it from here and run our final
+ # assertion after.
self._elements = _yaml.node_get(config, Mapping, 'elements', default_value={})
+ self._sources = _yaml.node_get(config, Mapping, 'sources', default_value={})
config.pop('elements', None)
+ config.pop('sources', None)
_yaml.node_final_assertions(config)
_yaml.node_validate(config, [
'format-version',