AutoTools: Use direct aspect registration in AutoreconfStep

Task-number: QTCREATORBUG-29168
Change-Id: I886e84a752031cabb8bf235dc4e83c8f78ae88cb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-06-29 18:00:06 +02:00
parent 941c99c893
commit e53bc1630a

View File

@@ -11,7 +11,6 @@
#include <projectexplorer/processparameters.h> #include <projectexplorer/processparameters.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <utils/aspects.h> #include <utils/aspects.h>
@@ -34,34 +33,25 @@ namespace AutotoolsProjectManager::Internal {
class AutoreconfStep final : public AbstractProcessStep class AutoreconfStep final : public AbstractProcessStep
{ {
public: public:
AutoreconfStep(BuildStepList *bsl, Id id); AutoreconfStep(BuildStepList *bsl, Id id)
void doRun() override;
private:
bool m_runAutoreconf = false;
};
AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id) : AbstractProcessStep(bsl, id)
{ {
auto arguments = addAspect<StringAspect>(); arguments.setSettingsKey("AutotoolsProjectManager.AutoreconfStep.AdditionalArguments");
arguments->setSettingsKey("AutotoolsProjectManager.AutoreconfStep.AdditionalArguments"); arguments.setLabelText(Tr::tr("Arguments:"));
arguments->setLabelText(Tr::tr("Arguments:")); arguments.setValue("--force --install");
arguments->setValue("--force --install"); arguments.setDisplayStyle(StringAspect::LineEditDisplay);
arguments->setDisplayStyle(StringAspect::LineEditDisplay); arguments.setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs");
arguments->setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs");
connect(arguments, &BaseAspect::changed, this, [this] { connect(&arguments, &BaseAspect::changed, this, [this] { m_runAutoreconf = true; });
m_runAutoreconf = true;
setCommandLineProvider([this] {
return CommandLine("autoreconf", arguments(), CommandLine::Raw);
}); });
setCommandLineProvider([arguments] { setWorkingDirectoryProvider([this] {
return CommandLine("autoreconf", arguments->value(), CommandLine::Raw); return project()->projectDirectory();
}); });
setWorkingDirectoryProvider([this] { return project()->projectDirectory(); });
setSummaryUpdater([this] { setSummaryUpdater([this] {
ProcessParameters param; ProcessParameters param;
setupProcessParameters(&param); setupProcessParameters(&param);
@@ -69,7 +59,7 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Id id)
}); });
} }
void AutoreconfStep::doRun() void doRun() override
{ {
// Check whether we need to run autoreconf // Check whether we need to run autoreconf
const FilePath configure = project()->projectDirectory() / "configure"; const FilePath configure = project()->projectDirectory() / "configure";
@@ -87,6 +77,12 @@ void AutoreconfStep::doRun()
AbstractProcessStep::doRun(); AbstractProcessStep::doRun();
} }
private:
bool m_runAutoreconf = false;
StringAspect arguments{this};
};
// AutoreconfStepFactory // AutoreconfStepFactory
/** /**