aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-08-18 09:29:05 +0200
committerEike Ziller <eike.ziller@qt.io>2021-08-18 09:29:31 +0200
commit91e0e3b5fb8b6cb40b2368ec16fde5442c73a473 (patch)
tree12e86a14703263a0dd9db0b0a4de9ded7ea11dba /plugins
parentb6fda4cd77d2e2b6d16eeef5c8f343cc2d498de4 (diff)
parent4cab24a7ca96bd042617a2936b52c9799f395030 (diff)
Merge remote-tracking branch 'origin/5.0'
Diffstat (limited to 'plugins')
-rw-r--r--plugins/haskell/stackbuildstep.cpp36
-rw-r--r--plugins/haskell/stackbuildstep.h3
2 files changed, 15 insertions, 24 deletions
diff --git a/plugins/haskell/stackbuildstep.cpp b/plugins/haskell/stackbuildstep.cpp
index 26c3006..52ed64f 100644
--- a/plugins/haskell/stackbuildstep.cpp
+++ b/plugins/haskell/stackbuildstep.cpp
@@ -42,30 +42,6 @@ StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id
: AbstractProcessStep(bsl, id)
{
setDefaultDisplayName(trDisplayName());
-
- const auto updateCommandLine = [this] {
- const auto projectDir = QDir(project()->projectDirectory().toString());
- processParameters()->setCommandLine(
- {HaskellManager::stackExecutable(),
- {"build",
- "--work-dir",
- projectDir.relativeFilePath(buildConfiguration()->buildDirectory().toString())}});
- };
- const auto updateEnvironment = [this] {
- processParameters()->setEnvironment(buildConfiguration()->environment());
- };
- updateCommandLine();
- processParameters()->setWorkingDirectory(project()->projectDirectory());
- updateEnvironment();
- connect(HaskellManager::instance(),
- &HaskellManager::stackExecutableChanged,
- this,
- updateCommandLine);
- connect(buildConfiguration(),
- &BuildConfiguration::buildDirectoryChanged,
- this,
- updateCommandLine);
- connect(buildConfiguration(), &BuildConfiguration::environmentChanged, this, updateEnvironment);
}
QWidget *StackBuildStep::createConfigWidget()
@@ -78,6 +54,18 @@ QString StackBuildStep::trDisplayName()
return tr("Stack Build");
}
+bool StackBuildStep::init()
+{
+ if (AbstractProcessStep::init()) {
+ const auto projectDir = QDir(project()->projectDirectory().toString());
+ processParameters()->setCommandLine(
+ {HaskellManager::stackExecutable(),
+ {"build", "--work-dir", projectDir.relativeFilePath(buildDirectory().toString())}});
+ processParameters()->setEnvironment(buildEnvironment());
+ }
+ return true;
+}
+
StackBuildStepFactory::StackBuildStepFactory()
{
registerStep<StackBuildStep>(Constants::C_STACK_BUILD_STEP_ID);
diff --git a/plugins/haskell/stackbuildstep.h b/plugins/haskell/stackbuildstep.h
index 98938f5..d74d155 100644
--- a/plugins/haskell/stackbuildstep.h
+++ b/plugins/haskell/stackbuildstep.h
@@ -40,6 +40,9 @@ public:
QWidget *createConfigWidget() override;
static QString trDisplayName();
+
+protected:
+ bool init() override;
};
class StackBuildStepFactory : public ProjectExplorer::BuildStepFactory