diff --git a/documentation/userguide/configmodel.rst b/documentation/userguide/configmodel.rst index c22a52163e9d298583c8362223777ad69dbdd082..588a62cac0d99db8e08f97860b3844dbe9f6eff6 100644 --- a/documentation/userguide/configmodel.rst +++ b/documentation/userguide/configmodel.rst @@ -122,20 +122,20 @@ output to get a better feel for how they work. See Defined Macros -------------- -======================= =============================================================================== ==== -macro scope description -======================= =============================================================================== ==== -``${param:sourcedir}`` build..{params, prebuild, build, postbuild, artifacts} Directory in which the component's source code is located. -``${param:builddir}`` build..{params, prebuild, build, postbuild, artifacts} Directory in which the component should be built, if the component's build system supports separation of source and build trees. -``${param:configdir}`` build..{params, prebuild, build, postbuild, artifacts} Directory containing the config store. This MUST only be used for resolving files that already exist in the store. -``${param:jobs}`` build..{params, prebuild, build, postbuild, artifacts} Maximum number of low level parallel jobs specified on the command line. To be passed to (e.g.) make as ``-j${param:jobs}``. -``${btvar:}`` build..{params, prebuild, build, postbuild, artifacts}, run.rtvars Build-time variables. The variable names, along with default values are declared in buildex.btvars, and the user may override the value on the command line. -``${param:join_equal}`` build..{prebuild, build, postbuild} String containing all of the component's parameters (from its params dictionary), concatenated as ``key=value`` pairs. -``${param:join_space}`` build..{prebuild, build, postbuild} String containing all of the component's parameters (from its params dictionary), concatenated as ``key value`` pairs. -``${artifact:}`` build..{params, prebuild, build, postbuild, artifacts}, build.btvars Build path of an artifact declared by another component. Usage of these macros determine the component build dependency graph. -``${artifact:}`` run.rtvars Package path of an artifact. -``${rtvar:}`` run.params Run-time variables. The variable names, along with default values are declared in run.rtvars, and the user may override the value on the command line. -======================= =============================================================================== ==== +======================= ===================================================================================================================== ==== +macro scope description +======================= ===================================================================================================================== ==== +``${param:sourcedir}`` build..{params, prebuild, build, postbuild, artifacts} Directory in which the component's source code is located. +``${param:builddir}`` build..{params, prebuild, build, postbuild, artifacts} Directory in which the component should be built, if the component's build system supports separation of source and build trees. +``${param:configdir}`` build..{params, prebuild, build, postbuild, artifacts} Directory containing the config store. This MUST only be used for resolving files that already exist in the store. +``${param:jobs}`` build..{params, prebuild, build, postbuild, artifacts} Maximum number of low level parallel jobs specified on the command line. To be passed to (e.g.) make as ``-j${param:jobs}``. +``${btvar:}`` build..{sourcedir, builddir, repo, toolchain, params, prebuild, build, postbuild, artifacts}, run.rtvars Build-time variables. The variable names, along with default values are declared in buildex.btvars, and the user may override the value on the command line. +``${param:join_equal}`` build..{prebuild, build, postbuild} String containing all of the component's parameters (from its params dictionary), concatenated as ``key=value`` pairs. +``${param:join_space}`` build..{prebuild, build, postbuild} String containing all of the component's parameters (from its params dictionary), concatenated as ``key value`` pairs. +``${artifact:}`` build..{params, prebuild, build, postbuild, artifacts}, build.btvars Build path of an artifact declared by another component. Usage of these macros determine the component build dependency graph. +``${artifact:}`` run.rtvars Package path of an artifact. +``${rtvar:}`` run.params Run-time variables. The variable names, along with default values are declared in run.rtvars, and the user may override the value on the command line. +======================= ===================================================================================================================== ==== ****** Schema diff --git a/shrinkwrap/utils/config.py b/shrinkwrap/utils/config.py index 8c7d95a480bc0f3172737e56fb4e863779a517a2..fbf673100c3d2802ae0a92f5a2e9de681fa37081 100644 --- a/shrinkwrap/utils/config.py +++ b/shrinkwrap/utils/config.py @@ -526,6 +526,9 @@ def resolveb(config, btvars={}, clivars={}): def _substitute_macros(config, lut, final): for desc in config['build'].values(): + desc['sourcedir'] = _string_substitute(desc['sourcedir'], lut, final) + desc['builddir'] = _string_substitute(desc['builddir'], lut, final) + lut['param']['sourcedir'] = desc['sourcedir'] lut['param']['builddir'] = desc['builddir'] @@ -536,6 +539,15 @@ def resolveb(config, btvars={}, clivars={}): lut['param']['join_equal'] = _mk_params(desc['params'], '=') lut['param']['join_space'] = _mk_params(desc['params'], ' ') + for r in desc['repo'].values(): + if r['remote']: + r['remote'] = _string_substitute(r['remote'], lut, final) + if r['revision']: + r['revision'] = _string_substitute(r['revision'], lut, final) + + if desc['toolchain']: + desc['toolchain'] = _string_substitute(desc['toolchain'], lut, final) + for i, s in enumerate(desc['prebuild']): desc['prebuild'][i] = _string_substitute(s, lut, final) for i, s in enumerate(desc['build']):