aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/incredibuild/buildconsolebuildstep.h
blob: 60cabc874095e1d7220518324ddba8c6ef3cea57 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

#pragma once

#include "commandbuilder.h"

#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildsteplist.h>

#include <QList>

namespace IncrediBuild {
namespace Internal {

class BuildConsoleBuildStep : public ProjectExplorer::AbstractProcessStep
{
    Q_OBJECT
public:
    explicit BuildConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList, Utils::Id id);
    ~BuildConsoleBuildStep() override;

    bool init() override;

    ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;

    bool fromMap(const QVariantMap &map) override;
    QVariantMap toMap() const override;

    bool avoidLocal() const { return m_avoidLocal; }
    void avoidLocal(bool avoidLocal) { m_avoidLocal = avoidLocal; }

    const QString &profileXml() const { return m_profileXml; }
    void profileXml(const QString &profileXml) { m_profileXml = profileXml; }

    int maxCpu() const { return m_maxCpu; }
    void maxCpu(int maxCpu) { m_maxCpu = maxCpu; }

    const QStringList& supportedWindowsVersions() const;
    const QString &maxWinVer() const { return m_maxWinVer; }
    void maxWinVer(const QString &maxWinVer) { m_maxWinVer = maxWinVer; }

    const QString &minWinVer() const { return m_minWinVer; }
    void minWinVer(const QString &minWinVer) { m_minWinVer = minWinVer; }

    const QString &title() const { return m_title; }
    void title(const QString &title) { m_title = title; }

    const QString &monFile() const { return m_monFile; }
    void monFile(const QString &monFile) { m_monFile = monFile; }

    bool suppressStdOut() const { return m_suppressStdOut; }
    void suppressStdOut(bool suppressStdOut) { m_suppressStdOut = suppressStdOut; }

    const QString &logFile() const { return m_logFile; }
    void logFile(const QString &logFile) { m_logFile = logFile; }

    bool showCmd() const { return m_showCmd; }
    void showCmd(bool showCmd) { m_showCmd = showCmd; }

    bool showAgents() const { return m_showAgents; }
    void showAgents(bool showAgents) { m_showAgents = showAgents; }

    bool showTime() const { return m_showTime; }
    void showTime(bool showTime) { m_showTime = showTime; }

    bool hideHeader() const { return m_hideHeader; }
    void hideHeader(bool hideHeader) { m_hideHeader = hideHeader; }

    const QStringList& supportedLogLevels() const;
    const QString &logLevel() const { return m_logLevel; }
    void logLevel(const QString &logLevel) { m_logLevel = logLevel; }

    const QString &setEnv() const { return m_setEnv; }
    void setEnv(const QString &setEnv) { m_setEnv = setEnv; }

    bool stopOnError() const { return m_stopOnError; }
    void stopOnError(bool stopOnError) { m_stopOnError = stopOnError; }

    const QString &additionalArguments() const { return m_additionalArguments; }
    void additionalArguments(const QString &additionalArguments) { m_additionalArguments = additionalArguments; }

    bool openMonitor() const { return m_openMonitor; }
    void openMonitor(bool openMonitor) { m_openMonitor = openMonitor; }

    bool keepJobNum() const { return m_keepJobNum; }
    void keepJobNum(bool keepJobNum) { m_keepJobNum = keepJobNum; }

    const QStringList& supportedCommandBuilders();
    CommandBuilder *commandBuilder() const { return m_activeCommandBuilder; }
    void commandBuilder(const QString &commandBuilder);

    bool loadedFromMap() const { return m_loadedFromMap; }
    void tryToMigrate();

    void setupOutputFormatter(Utils::OutputFormatter *formatter) override;

private:
    void initCommandBuilders();
    QString normalizeWinVerArgument(QString winVer);

    ProjectExplorer::BuildStepList *m_earlierSteps{};
    bool m_loadedFromMap{false};
    bool m_avoidLocal{false};
    QString m_profileXml{};
    int m_maxCpu{0};
    QString m_maxWinVer{};
    QString m_minWinVer{};
    QString m_title{};
    QString m_monFile{};
    bool m_suppressStdOut{false};
    QString m_logFile{};
    bool m_showCmd{false};
    bool m_showAgents{false};
    bool m_showTime{false};
    bool m_hideHeader{false};
    QString m_logLevel{};
    QString m_setEnv{};
    bool m_stopOnError{false};
    QString m_additionalArguments{};
    bool m_openMonitor{true};
    bool m_keepJobNum{false};
    CommandBuilder* m_activeCommandBuilder{};
    QList<CommandBuilder*> m_commandBuildersList{};
};

} // namespace Internal
} // namespace IncrediBuild