aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/abstractprocessstep.h
blob: ef52e648c004d4614a4d5be0c2ca36e4f7b1b0a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "buildstep.h"

namespace Utils {
class CommandLine;
class Process;
}

namespace ProjectExplorer {
class ProcessParameters;

// Documentation inside.
class PROJECTEXPLORER_EXPORT AbstractProcessStep : public BuildStep
{
    Q_OBJECT

public:
    ProcessParameters *processParameters();

protected:
    AbstractProcessStep(BuildStepList *bsl, Utils::Id id);
    ~AbstractProcessStep() override;

    bool setupProcessParameters(ProcessParameters *params) const;
    bool ignoreReturnValue() const;
    void setIgnoreReturnValue(bool b);
    void setCommandLineProvider(const std::function<Utils::CommandLine()> &provider);
    void setWorkingDirectoryProvider(const std::function<Utils::FilePath()> &provider);
    void setEnvironmentModifier(const std::function<void(Utils::Environment &)> &modifier);
    void setUseEnglishOutput();

    void emitFaultyConfigurationMessage();

    bool init() override;
    void setupOutputFormatter(Utils::OutputFormatter *formatter) override;
    void setLowPriority();
    void setDisplayedParameters(ProcessParameters *params);

    Tasking::GroupItem defaultProcessTask();
    bool setupProcess(Utils::Process &process);
    void handleProcessDone(const Utils::Process &process);

private:
    Tasking::GroupItem runRecipe() override;

    class Private;
    Private *d;
};

} // namespace ProjectExplorer