diff --git a/src/python/jw/pkg/cmds/projects/CmdBuild.py b/src/python/jw/pkg/cmds/projects/CmdBuild.py index c8e51c0e..9f2f3f43 100644 --- a/src/python/jw/pkg/cmds/projects/CmdBuild.py +++ b/src/python/jw/pkg/cmds/projects/CmdBuild.py @@ -53,6 +53,14 @@ class CmdBuild(Cmd): # export '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( '--env-reinit', action = 'store_true', @@ -247,9 +255,12 @@ class CmdBuild(Cmd): # export # -- build order: list[str] = [] - dep_flavours = ['build'] - if re.match('pkg-.*', target) is not None: - dep_flavours = ['build', 'run', 'release', 'devel'] + if args.dep_flavours != 'auto': + dep_flavours = re.split(r'[\s,]', args.dep_flavours) + 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: log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours)) diff --git a/test/integration/jw-pkg/help/test-expected.txt b/test/integration/jw-pkg/help/test-expected.txt index 66b44f81..0ff7611a 100644 --- a/test/integration/jw-pkg/help/test-expected.txt +++ b/test/integration/jw-pkg/help/test-expected.txt @@ -254,31 +254,35 @@ Available subcommands of projects: tmpl-dir Print directory containing templates of a given module ============= Running: jw-pkg.py --log-level info projects build --help 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 ...] janware software project build tool positional arguments: - target Build target - modules Modules to be built + target Build target + modules Modules to be built options: - -h, --help show this help message and exit - --exclude EXCLUDE Space seperated ist of modules to be excluded from - build (default: ) - -n, --dry-run Don't build anything, just print what would be done. - (default: False) - -O, --build-order Don't build anything, just print the build order. - (default: False) - -I, --ignore-deps Don't build dependencies, i.e. build only modules - specified on the command line (default: False) - --env-reinit Source /etc/profile before each build step. Discard - environment unless --env-keep is specified (default: - 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) + -h, --help show this help message and exit + --exclude EXCLUDE Space seperated ist of modules to be excluded from + build (default: ) + -n, --dry-run Don't build anything, just print what would be done. + (default: False) + -O, --build-order Don't build anything, just print the build order. + (default: False) + -I, --ignore-deps Don't build dependencies, i.e. build only modules + specified on the command line (default: False) + --dep-flavours DEP_FLAVOURS + Dependency flavours to take into consideration for + build, comma or space separated (default: auto) + --env-reinit Source /etc/profile before each build step. Discard + environment unless --env-keep is specified (default: + 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 --log-level info projects canonicalize-remotes --help usage: jw-pkg.py projects canonicalize-remotes [-h] [-n]