From 61ccf365096bee6f03dac845ad7c8c4d1c2424b8 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 8 Feb 2022 11:02:04 +0100 Subject: [PATCH] Introduce support for plugins (#744) --- alibuild_helpers/args.py | 1 + alibuild_helpers/build.py | 5 +++++ tests/test_build.py | 1 + 3 files changed, 7 insertions(+) diff --git a/alibuild_helpers/args.py b/alibuild_helpers/args.py index dd6a856d..a3785005 100644 --- a/alibuild_helpers/args.py +++ b/alibuild_helpers/args.py @@ -94,6 +94,7 @@ def doParseArgs(star): "%(metavar)s is a comma-separated list.")) build_parser.add_argument("--force-tracked", dest="forceTracked", default=False, action="store_true", help=("Do not pick up any packages from a local checkout. ")) + build_parser.add_argument("--plugin", dest="plugin", default="legacy", help=("Plugin to use to do the actual build. ")) build_parser.add_argument("--disable", dest="disable", default=[], metavar="PACKAGE", action="append", help="Do not build %(metavar)s and all its (unique) dependencies.") diff --git a/alibuild_helpers/build.py b/alibuild_helpers/build.py index 30b92c99..2d82233f 100644 --- a/alibuild_helpers/build.py +++ b/alibuild_helpers/build.py @@ -529,6 +529,11 @@ def downloadTask(p): ), args.architecture) + if args.plugin != "legacy": + build_plugin = __import__("alibuild_helpers.%s_plugin" % args.plugin, fromlist=['']) + build_plugin.build_plugin(specs, args, buildOrder) + return + while buildOrder: packageIterations += 1 if packageIterations > 20: diff --git a/tests/test_build.py b/tests/test_build.py index aca0a4a6..39c1aecd 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -259,6 +259,7 @@ def test_coverDoBuild(self, mock_debug, mock_glob, mock_sys, mock_sync_execute, noDevel=[], fetchRepos=False, forceTracked=False, + plugin="legacy" ) mock_sys.version_info = sys.version_info