aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-01-31 14:05:19 +0100
committerhjk <hjk@qt.io>2020-01-31 14:00:29 +0000
commitb5188475a52b052a1b771cb6f60a1dd249b30126 (patch)
tree52769bae0a3cf5b4cf2eb012fc748c8bac47a13a /plugins
parent9dd2477c2a9f7383e9eaa0b6f6b1f7691baae1f1 (diff)
Adapt to upstream build configuration factory changes
Change-Id: I6b541df3ee1599be17e5fec17cc7fa251061ba4d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/haskell/haskellbuildconfiguration.cpp29
-rw-r--r--plugins/haskell/haskellbuildconfiguration.h6
-rw-r--r--plugins/haskell/haskellconstants.h1
-rw-r--r--plugins/haskell/stackbuildstep.cpp9
-rw-r--r--plugins/haskell/stackbuildstep.h2
5 files changed, 18 insertions, 29 deletions
diff --git a/plugins/haskell/haskellbuildconfiguration.cpp b/plugins/haskell/haskellbuildconfiguration.cpp
index dcd582a..a587ef1 100644
--- a/plugins/haskell/haskellbuildconfiguration.cpp
+++ b/plugins/haskell/haskellbuildconfiguration.cpp
@@ -27,7 +27,6 @@
#include "haskellconstants.h"
#include "haskellproject.h"
-#include "stackbuildstep.h"
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildsteplist.h>
@@ -56,20 +55,18 @@ HaskellBuildConfigurationFactory::HaskellBuildConfigurationFactory()
registerBuildConfiguration<HaskellBuildConfiguration>(C_HASKELL_BUILDCONFIGURATION_ID);
setSupportedProjectType(Constants::C_HASKELL_PROJECT_ID);
setSupportedProjectMimeTypeName(Constants::C_HASKELL_PROJECT_MIMETYPE);
-}
-QList<BuildInfo> HaskellBuildConfigurationFactory::availableBuilds(
- const Kit *k, const Utils::FilePath &projectPath, bool forSetup) const
-{
- BuildInfo info(this);
- info.typeName = HaskellBuildConfigurationFactory::tr("Release");
- if (forSetup) {
- info.displayName = info.typeName;
- info.buildDirectory = projectPath.parentDir().pathAppended(".stack-work");
- }
- info.kitId = k->id();
- info.buildType = BuildConfiguration::BuildType::Release;
- return {info};
+ setBuildGenerator([](const Kit *k, const Utils::FilePath &projectPath, bool forSetup) {
+ BuildInfo info;
+ info.typeName = HaskellBuildConfiguration::tr("Release");
+ if (forSetup) {
+ info.displayName = info.typeName;
+ info.buildDirectory = projectPath.parentDir().pathAppended(".stack-work");
+ }
+ info.kitId = k->id();
+ info.buildType = BuildConfiguration::BuildType::Release;
+ return QList<BuildInfo>{info};
+ });
}
HaskellBuildConfiguration::HaskellBuildConfiguration(Target *target, Core::Id id)
@@ -79,10 +76,8 @@ HaskellBuildConfiguration::HaskellBuildConfiguration(Target *target, Core::Id id
setBuildDirectory(info.buildDirectory);
setBuildType(info.buildType);
setDisplayName(info.displayName);
-
- auto stackBuildStep = new StackBuildStep(buildSteps());
- buildSteps()->appendStep(stackBuildStep);
});
+ appendInitialBuildStep(Constants::C_STACK_BUILD_STEP_ID);
}
NamedWidget *HaskellBuildConfiguration::createConfigWidget()
diff --git a/plugins/haskell/haskellbuildconfiguration.h b/plugins/haskell/haskellbuildconfiguration.h
index f07f918..580ec2d 100644
--- a/plugins/haskell/haskellbuildconfiguration.h
+++ b/plugins/haskell/haskellbuildconfiguration.h
@@ -33,14 +33,8 @@ namespace Internal {
class HaskellBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationFactory
{
- Q_OBJECT
-
public:
HaskellBuildConfigurationFactory();
-
- QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
- const Utils::FilePath &projectPath,
- bool forSetup) const override;
};
class HaskellBuildConfiguration : public ProjectExplorer::BuildConfiguration
diff --git a/plugins/haskell/haskellconstants.h b/plugins/haskell/haskellconstants.h
index 9dd18a6..8428ec1 100644
--- a/plugins/haskell/haskellconstants.h
+++ b/plugins/haskell/haskellconstants.h
@@ -33,6 +33,7 @@ const char C_HASKELLSNIPPETSGROUP_ID[] = "Haskell";
const char C_HASKELL_PROJECT_MIMETYPE[] = "text/x-haskell-project";
const char C_HASKELL_PROJECT_ID[] = "Haskell.Project";
const char C_HASKELL_RUNCONFIG_ID[] = "Haskell.RunConfiguration";
+const char C_STACK_BUILD_STEP_ID[] = "Haskell.Stack.Build";
const char OPTIONS_GENERAL[] = "Haskell.A.General";
} // namespace Haskell
diff --git a/plugins/haskell/stackbuildstep.cpp b/plugins/haskell/stackbuildstep.cpp
index 25b6622..c965064 100644
--- a/plugins/haskell/stackbuildstep.cpp
+++ b/plugins/haskell/stackbuildstep.cpp
@@ -25,6 +25,7 @@
#include "stackbuildstep.h"
+#include "haskellconstants.h"
#include "haskellmanager.h"
#include <projectexplorer/buildconfiguration.h>
@@ -34,13 +35,11 @@
using namespace ProjectExplorer;
-const char C_STACK_BUILD_STEP_ID[] = "Haskell.Stack.Build";
-
namespace Haskell {
namespace Internal {
-StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl)
- : AbstractProcessStep(bsl, C_STACK_BUILD_STEP_ID)
+StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl, Core::Id id)
+ : AbstractProcessStep(bsl, id)
{
setDefaultDisplayName(trDisplayName());
@@ -81,7 +80,7 @@ QString StackBuildStep::trDisplayName()
StackBuildStepFactory::StackBuildStepFactory()
{
- registerStep<StackBuildStep>(C_STACK_BUILD_STEP_ID);
+ registerStep<StackBuildStep>(Constants::C_STACK_BUILD_STEP_ID);
setDisplayName(StackBuildStep::StackBuildStep::trDisplayName());
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
}
diff --git a/plugins/haskell/stackbuildstep.h b/plugins/haskell/stackbuildstep.h
index e03ab97..7876859 100644
--- a/plugins/haskell/stackbuildstep.h
+++ b/plugins/haskell/stackbuildstep.h
@@ -35,7 +35,7 @@ class StackBuildStep : public ProjectExplorer::AbstractProcessStep
Q_OBJECT
public:
- StackBuildStep(ProjectExplorer::BuildStepList *bsl);
+ StackBuildStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;