[sdk/kdesrc-build] /: Add build-system query mode
Andrew Shark
null at kde.org
Sat Feb 10 12:33:47 GMT 2024
Git commit 139fdc94f4e4a469ff3b0f245a3626f3b58e3556 by Andrew Shark.
Committed on 10/02/2024 at 12:33.
Pushed by ashark into branch 'master'.
Add build-system query mode
M +4 -0 doc/man-kdesrc-build.1.docbook
M +4 -0 doc/supported-cmdline-params.docbook
M +2 -0 modules/ksb/Application.pm
https://invent.kde.org/sdk/kdesrc-build/-/commit/139fdc94f4e4a469ff3b0f245a3626f3b58e3556
diff --git a/doc/man-kdesrc-build.1.docbook b/doc/man-kdesrc-build.1.docbook
index d8c7f41c..bdadfe7e 100644
--- a/doc/man-kdesrc-build.1.docbook
+++ b/doc/man-kdesrc-build.1.docbook
@@ -683,6 +683,10 @@ one of the following:</para>
<listitem><para><option>module-set</option>, which causes &kdesrc-build; to
output the name of module-set which contains the module. This can be used
to generate zsh autocompletion cache.</para></listitem>
+ <listitem><para><option>build-system</option>, which causes &kdesrc-build; to
+ output the name of build system detected for the module. This can be used
+ to debug build system auto-detection problems, or when developing tests for specific build systems.
+ </para></listitem>
<listitem><para>Otherwise, option names that are valid for modules in the
configuration file can be used, the resolved value of which will be
listed for each module.
diff --git a/doc/supported-cmdline-params.docbook b/doc/supported-cmdline-params.docbook
index 86eaf976..95367ed7 100644
--- a/doc/supported-cmdline-params.docbook
+++ b/doc/supported-cmdline-params.docbook
@@ -306,6 +306,10 @@ one of the following:</para>
output the name of module-set which contains the module. This can be used
to generate zsh autocompletion cache.
</para></listitem>
+ <listitem><para><parameter>build-system</parameter>, which causes &kdesrc-build; to
+ output the name of build system detected for the module. This can be used
+ to debug build system auto-detection problems, or when developing tests for specific build systems.
+ </para></listitem>
<listitem><para>Any option name that is valid for modules in the
<link linkend="conf-options-table">configuration file</link>.
</para></listitem>
diff --git a/modules/ksb/Application.pm b/modules/ksb/Application.pm
index 0bc1b082..73ec5b12 100644
--- a/modules/ksb/Application.pm
+++ b/modules/ksb/Application.pm
@@ -624,6 +624,8 @@ sub runAllModulePhases
$query = sub {($_[0]->scm()->_determinePreferredCheckoutSource())[0] // ""}
} elsif ($queryMode eq "module-set") {
$query = sub { $_[0]->{"module-set"}->{"name"} // "undefined_module-set"}
+ } elsif ($queryMode eq "build-system") {
+ $query = sub { $_[0]->buildSystem()->name() }
} else { # Default to ->getOption as query method.
$query = sub { $_[0]->getOption($queryMode) }
}
More information about the kde-doc-english
mailing list