AbstractProcessStep: Remove processStarted() virtual method

Add concealedParameters / setConcealedParameters instead, to be
used in AndroidBuildApkStep.

Use concealed parameters also on start failure and on done.

By default, concealedParameters() equals processParameters()
(i.e. no sensitive data to hide) unless the implementation decides
to replace some sensitive data (e.g. password) with asterisks.
In this case the reimplementation needs to store separate instance
of ProcessParameters and redirect the pointer of
concealedParameters() into own structure.
This is being done through a call to setConcealedParameters().

Change-Id: I8b1573b007c0f8a10c9592ccaf25e6f088f04691
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-12-02 13:59:33 +01:00
parent 7cf6d9c97b
commit ebe708c1a3
4 changed files with 34 additions and 44 deletions

View File

@@ -578,12 +578,9 @@ bool AndroidBuildApkStep::init()
processParameters()->setCommandLine({command, arguments});
// Generate arguments with keystore password concealed
ProjectExplorer::ProcessParameters pp2;
setupProcessParameters(&pp2);
pp2.setCommandLine({command, argumentsPasswordConcealed});
m_command = pp2.effectiveCommand();
m_argumentsPasswordConcealed = pp2.prettyArguments();
setupProcessParameters(&m_concealedParams);
m_concealedParams.setCommandLine({command, argumentsPasswordConcealed});
setDisplayedParameters(&m_concealedParams);
return true;
}
@@ -836,13 +833,6 @@ void AndroidBuildApkStep::reportWarningOrError(const QString &message, Task::Tas
TaskHub::addTask(BuildSystemTask(type, message));
}
void AndroidBuildApkStep::processStarted()
{
emit addOutput(Tr::tr("Starting: \"%1\" %2")
.arg(m_command.toUserOutput(), m_argumentsPasswordConcealed),
BuildStep::OutputFormat::NormalMessage);
}
bool AndroidBuildApkStep::fromMap(const QVariantMap &map)
{
m_keystorePath = FilePath::fromVariant(map.value(KeystoreLocationKey));