diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2022-09-22 17:14:55 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2022-10-04 07:43:01 +0000 |
commit | a29bbf5568bf651b076f051720a98e9d0297faa9 (patch) | |
tree | 5d99c12c7d9735e7f113c3a04ccf95746ef8dedc /src/app/qbs/parser/commandlineoption.h | |
parent | 512001849af89e4b2c5bfb18b039387d6fe7aaa6 (diff) |
Make handling of deprecated items and properties configurable
As of now, a newly deprecated property leads to users getting bombarded
with warnings, even though they did not yet have a chance to adapt their
project.
Now the warnings appear by default one minor version before removal,
which together with our convention of keeping deprecated properties for
at least two minor versions gives users enough time to adapt without
getting spammed.
There is also a mode for switching to the previous behavior (for early
detection), as well as the possibility to trigger errors instead of
warnings, which should be helpful in CI configurations.
To support the case where the user cannot do anything about them, the
warnings can also be suppressed altogether.
Change-Id: I295f816758f0f111fcb0351581a4328be3af5668
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src/app/qbs/parser/commandlineoption.h')
-rw-r--r-- | src/app/qbs/parser/commandlineoption.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app/qbs/parser/commandlineoption.h b/src/app/qbs/parser/commandlineoption.h index f8ec1c735..d51d5f765 100644 --- a/src/app/qbs/parser/commandlineoption.h +++ b/src/app/qbs/parser/commandlineoption.h @@ -42,6 +42,7 @@ #include "commandtype.h" #include <tools/commandechomode.h> +#include <tools/deprecationwarningmode.h> #include <tools/joblimits.h> #include <QtCore/qstringlist.h> @@ -76,6 +77,7 @@ public: WaitLockOptionType, RunEnvConfigOptionType, DisableFallbackProviderType, + DeprecationWarningsOptionType, }; virtual ~CommandLineOption(); @@ -367,6 +369,20 @@ private: CommandEchoMode m_echoMode = CommandEchoModeInvalid; }; +class DeprecationWarningsOption : public CommandLineOption +{ +public: + QString description(CommandType command) const override; + QString shortRepresentation() const override { return {}; } + QString longRepresentation() const override; + DeprecationWarningMode mode() const { return m_mode; } + +private: + void doParse(const QString &representation, QStringList &input) override; + + DeprecationWarningMode m_mode = defaultDeprecationWarningMode(); +}; + class SettingsDirOption : public CommandLineOption { public: |