2023-01-27 14:44:20 +01:00
|
|
|
// Copyright (c) 2017 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2023-01-19 17:34:40 +01:00
|
|
|
|
|
|
|
|
#include "stackbuildstep.h"
|
|
|
|
|
|
|
|
|
|
#include "haskellconstants.h"
|
|
|
|
|
#include "haskellmanager.h"
|
2023-02-10 17:12:59 +01:00
|
|
|
#include "haskelltr.h"
|
2023-01-19 17:34:40 +01:00
|
|
|
|
|
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
|
|
|
|
#include <projectexplorer/processparameters.h>
|
|
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace Haskell {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id)
|
|
|
|
|
: AbstractProcessStep(bsl, id)
|
|
|
|
|
{
|
|
|
|
|
setDefaultDisplayName(trDisplayName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *StackBuildStep::createConfigWidget()
|
|
|
|
|
{
|
|
|
|
|
return new QWidget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString StackBuildStep::trDisplayName()
|
|
|
|
|
{
|
2023-02-10 17:12:59 +01:00
|
|
|
return Tr::tr("Stack Build");
|
2023-01-19 17:34:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
setDisplayName(StackBuildStep::StackBuildStep::trDisplayName());
|
|
|
|
|
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Haskell
|