cmds.projects.CmdBuild: Support --dep-flavours
CmdBuild supports the targets all, clean and pkg-*. It uses builtin dependency flavours matching those targets to resolve build order. To make it more flexible in general, and allow it to support more targets, e.g. "check" and "test", this commit adds a --dep-flavours option. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
b7431e5bc6
commit
41ca202142
2 changed files with 36 additions and 21 deletions
|
|
@ -53,6 +53,14 @@ class CmdBuild(Cmd): # export
|
||||||
'on the command line'
|
'on the command line'
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--dep-flavours',
|
||||||
|
default = 'auto',
|
||||||
|
help = (
|
||||||
|
'Dependency flavours to take into consideration for build, '
|
||||||
|
'comma or space separated'
|
||||||
|
)
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--env-reinit',
|
'--env-reinit',
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
|
|
@ -247,9 +255,12 @@ class CmdBuild(Cmd): # export
|
||||||
# -- build
|
# -- build
|
||||||
order: list[str] = []
|
order: list[str] = []
|
||||||
|
|
||||||
dep_flavours = ['build']
|
if args.dep_flavours != 'auto':
|
||||||
if re.match('pkg-.*', target) is not None:
|
dep_flavours = re.split(r'[\s,]', args.dep_flavours)
|
||||||
dep_flavours = ['build', 'run', 'release', 'devel']
|
else:
|
||||||
|
dep_flavours = ['build']
|
||||||
|
if re.match('pkg-.*', target) is not None:
|
||||||
|
dep_flavours.extend(['run', 'release', 'devel'])
|
||||||
|
|
||||||
if target != 'order' and not args.build_order:
|
if target != 'order' and not args.build_order:
|
||||||
log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours))
|
log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours))
|
||||||
|
|
|
||||||
|
|
@ -254,31 +254,35 @@ Available subcommands of projects:
|
||||||
tmpl-dir Print directory containing templates of a given module
|
tmpl-dir Print directory containing templates of a given module
|
||||||
============= Running: jw-pkg.py -t ../../../.. --log-level info projects build --help
|
============= Running: jw-pkg.py -t ../../../.. --log-level info projects build --help
|
||||||
usage: jw-pkg.py projects build [-h] [--exclude EXCLUDE] [-n] [-O] [-I]
|
usage: jw-pkg.py projects build [-h] [--exclude EXCLUDE] [-n] [-O] [-I]
|
||||||
[--env-reinit] [--env-keep ENV_KEEP]
|
[--dep-flavours DEP_FLAVOURS] [--env-reinit]
|
||||||
|
[--env-keep ENV_KEEP]
|
||||||
target modules [modules ...]
|
target modules [modules ...]
|
||||||
|
|
||||||
janware software project build tool
|
janware software project build tool
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
target Build target
|
target Build target
|
||||||
modules Modules to be built
|
modules Modules to be built
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
--exclude EXCLUDE Space seperated ist of modules to be excluded from
|
--exclude EXCLUDE Space seperated ist of modules to be excluded from
|
||||||
build (default: )
|
build (default: )
|
||||||
-n, --dry-run Don't build anything, just print what would be done.
|
-n, --dry-run Don't build anything, just print what would be done.
|
||||||
(default: False)
|
(default: False)
|
||||||
-O, --build-order Don't build anything, just print the build order.
|
-O, --build-order Don't build anything, just print the build order.
|
||||||
(default: False)
|
(default: False)
|
||||||
-I, --ignore-deps Don't build dependencies, i.e. build only modules
|
-I, --ignore-deps Don't build dependencies, i.e. build only modules
|
||||||
specified on the command line (default: False)
|
specified on the command line (default: False)
|
||||||
--env-reinit Source /etc/profile before each build step. Discard
|
--dep-flavours DEP_FLAVOURS
|
||||||
environment unless --env-keep is specified (default:
|
Dependency flavours to take into consideration for
|
||||||
False)
|
build, comma or space separated (default: auto)
|
||||||
--env-keep ENV_KEEP Comma seperated list of environment variables to keep,
|
--env-reinit Source /etc/profile before each build step. Discard
|
||||||
"all" or "none", only meaningful if --env-reinit is
|
environment unless --env-keep is specified (default:
|
||||||
specified (default: none)
|
False)
|
||||||
|
--env-keep ENV_KEEP Comma seperated list of environment variables to keep,
|
||||||
|
"all" or "none", only meaningful if --env-reinit is
|
||||||
|
specified (default: none)
|
||||||
============= Running: jw-pkg.py -t ../../../.. --log-level info projects canonicalize-remotes --help
|
============= Running: jw-pkg.py -t ../../../.. --log-level info projects canonicalize-remotes --help
|
||||||
usage: jw-pkg.py projects canonicalize-remotes [-h] [-n]
|
usage: jw-pkg.py projects canonicalize-remotes [-h] [-n]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue