forked from qt-creator/qt-creator
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:
@@ -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,43 +33,34 @@ 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(¶m);
|
setupProcessParameters(¶m);
|
||||||
return param.summary(displayName());
|
return param.summary(displayName());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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";
|
||||||
if (!configure.exists())
|
if (!configure.exists())
|
||||||
@@ -85,7 +75,13 @@ void AutoreconfStep::doRun()
|
|||||||
|
|
||||||
m_runAutoreconf = false;
|
m_runAutoreconf = false;
|
||||||
AbstractProcessStep::doRun();
|
AbstractProcessStep::doRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_runAutoreconf = false;
|
||||||
|
StringAspect arguments{this};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// AutoreconfStepFactory
|
// AutoreconfStepFactory
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user