summaryrefslogtreecommitdiff
path: root/shrinkwrap/utils/config.py
diff options
context:
space:
mode:
authorRyan Roberts <ryan.roberts@arm.com>2024-02-02 12:44:41 +0000
committerRyan Roberts <ryan.roberts@arm.com>2024-02-02 12:44:41 +0000
commit7ae91a697efef932da8cc4808552dd646a3bb702 (patch)
tree199afe077253b2d7bc91da87ebb03dee258899c6 /shrinkwrap/utils/config.py
parente3750169739d9c3dc402dae2d9c87418d9d0f812 (diff)
config: Allow btvars to be used as rtvar default values
This allows a single parameter to be specified that can be used at both build-time and run-time. A btvar is defined and set as normal. And a corresponding rtvar is defined with its default value set to the btvar macro. The user can still override the rtvar at runtime if they want. Example: buildex: btvars: MYPROP: type: string value: null build: mycomponent: params: myprop: ${btvar:MYPROP} run: rtvars: MYPROP: type: string value: ${btvar:MYPROP} params: -C myprop: ${rtvar:MYPROP} Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Diffstat (limited to 'shrinkwrap/utils/config.py')
-rw-r--r--shrinkwrap/utils/config.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/shrinkwrap/utils/config.py b/shrinkwrap/utils/config.py
index 0de5ff3..d55086c 100644
--- a/shrinkwrap/utils/config.py
+++ b/shrinkwrap/utils/config.py
@@ -653,6 +653,8 @@ def resolver(config, rtvars={}, clivars={}):
},
'artifact': {k: v['dst']
for k, v in config['artifacts'].items()},
+ 'btvar': {k: v['value']
+ for k, v in config['buildex']['btvars'].items()},
}
for k in run['rtvars']:
v = run['rtvars'][k]