aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOr Kunst <or.kunst@incredibuild.com>2020-03-11 17:03:23 +0200
committeror.kunst <or.kunst@incredibuild.com>2020-06-17 06:40:05 +0000
commit356d497df4bc746a9170d2e9d332f51aef7f3877 (patch)
tree35be0bd4f43b041e29d9559ec9611082a97b4852 /src
parentc5a64bd4decf163f6033711d19318cad6e75aa9c (diff)
New IncrediBuild plugin
- Using raw pointers instead of QSharedPointers. - Removing redundant pointers existence checks before delete. - Replacing empty quotes with explicit QString() instance creation. - A few spaces and tab fixes. - Save settings after migrating build steps Change-Id: Iff87d75c7047474ab8e49366ddfeced766ff1a67 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/CMakeLists.txt1
-rw-r--r--src/plugins/incredibuild/CMakeLists.txt30
-rw-r--r--src/plugins/incredibuild/IncrediBuild.json.in11
-rw-r--r--src/plugins/incredibuild/buildconsolebuildstep.cpp316
-rw-r--r--src/plugins/incredibuild/buildconsolebuildstep.h150
-rw-r--r--src/plugins/incredibuild/buildconsolebuildstep.ui356
-rw-r--r--src/plugins/incredibuild/buildconsolestepconfigwidget.cpp297
-rw-r--r--src/plugins/incredibuild/buildconsolestepconfigwidget.h76
-rw-r--r--src/plugins/incredibuild/buildconsolestepfactory.cpp56
-rw-r--r--src/plugins/incredibuild/buildconsolestepfactory.h44
-rw-r--r--src/plugins/incredibuild/cmakecommandbuilder.cpp107
-rw-r--r--src/plugins/incredibuild/cmakecommandbuilder.h55
-rw-r--r--src/plugins/incredibuild/commandbuilder.cpp143
-rw-r--r--src/plugins/incredibuild/commandbuilder.h77
-rw-r--r--src/plugins/incredibuild/ibconsolebuildstep.cpp196
-rw-r--r--src/plugins/incredibuild/ibconsolebuildstep.h87
-rw-r--r--src/plugins/incredibuild/ibconsolebuildstep.ui156
-rw-r--r--src/plugins/incredibuild/ibconsolestepconfigwidget.cpp163
-rw-r--r--src/plugins/incredibuild/ibconsolestepconfigwidget.h61
-rw-r--r--src/plugins/incredibuild/ibconsolestepfactory.cpp55
-rw-r--r--src/plugins/incredibuild/ibconsolestepfactory.h44
-rw-r--r--src/plugins/incredibuild/incredibuild.pro36
-rw-r--r--src/plugins/incredibuild/incredibuild.qbs37
-rw-r--r--src/plugins/incredibuild/incredibuild_dependencies.pri10
-rw-r--r--src/plugins/incredibuild/incredibuild_global.h34
-rw-r--r--src/plugins/incredibuild/incredibuildconstants.h37
-rw-r--r--src/plugins/incredibuild/incredibuildplugin.cpp75
-rw-r--r--src/plugins/incredibuild/incredibuildplugin.h56
-rw-r--r--src/plugins/incredibuild/makecommandbuilder.cpp102
-rw-r--r--src/plugins/incredibuild/makecommandbuilder.h51
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/plugins/plugins.qbs1
32 files changed, 2922 insertions, 1 deletions
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 05f97fde95a..70f8f42000b 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -26,6 +26,7 @@ add_subdirectory(help)
add_subdirectory(resourceeditor)
add_subdirectory(tasklist)
add_subdirectory(nim)
+add_subdirectory(incredibuild)
# Level 4: (only depends on Level 3 and below)
add_subdirectory(clangpchmanager)
diff --git a/src/plugins/incredibuild/CMakeLists.txt b/src/plugins/incredibuild/CMakeLists.txt
new file mode 100644
index 00000000000..16f7773f87f
--- /dev/null
+++ b/src/plugins/incredibuild/CMakeLists.txt
@@ -0,0 +1,30 @@
+add_qtc_plugin(IncrediBuild
+ PLUGIN_DEPENDS Core ProjectExplorer
+ PLUGIN_RECOMMENDS QmakeProjectManager CmakeProjectManager
+ SOURCES
+ buildconsolebuildstep.cpp
+ buildconsolebuildstep.h
+ buildconsolebuildstep.ui
+ buildconsolestepconfigwidget.cpp
+ buildconsolestepconfigwidget.h
+ buildconsolestepfactory.cpp
+ buildconsolestepfactory.h
+ cmakecommandbuilder.cpp
+ cmakecommandbuilder.h
+ commandbuilder.cpp
+ commandbuilder.h
+ ibconsolebuildstep.cpp
+ ibconsolebuildstep.h
+ ibconsolebuildstep.ui
+ ibconsolestepconfigwidget.cpp
+ ibconsolestepconfigwidget.h
+ ibconsolestepfactory.cpp
+ ibconsolestepfactory.h
+ incredibuild_global.h
+ incredibuildconstants.h
+ incredibuildplugin.cpp
+ incredibuildplugin.h
+ makecommandbuilder.cpp
+ makecommandbuilder.h
+)
+
diff --git a/src/plugins/incredibuild/IncrediBuild.json.in b/src/plugins/incredibuild/IncrediBuild.json.in
new file mode 100644
index 00000000000..788227daa72
--- /dev/null
+++ b/src/plugins/incredibuild/IncrediBuild.json.in
@@ -0,0 +1,11 @@
+{
+ \"Name\" : \"IncrediBuild\",
+ \"Version\" : \"$$QTCREATOR_VERSION\",
+ \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
+ \"Platform\" : \"^(Linux|Windows)\",
+ \"Vendor\" : \"IncrediBuild\",
+ \"Copyright\" : \"(C) IncrediBuild\",
+ \"Category\" : \"Build Systems\",
+ \"Url\" : \"http://www.IncrediBuild.com\",
+ $$dependencyList
+}
diff --git a/src/plugins/incredibuild/buildconsolebuildstep.cpp b/src/plugins/incredibuild/buildconsolebuildstep.cpp
new file mode 100644
index 00000000000..60c30e5c1be
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolebuildstep.cpp
@@ -0,0 +1,316 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "buildconsolebuildstep.h"
+
+#include "buildconsolestepconfigwidget.h"
+#include "cmakecommandbuilder.h"
+#include "incredibuildconstants.h"
+#include "makecommandbuilder.h"
+#include "ui_buildconsolebuildstep.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/gnumakeparser.h>
+#include <projectexplorer/kit.h>
+#include <projectexplorer/processparameters.h>
+#include <projectexplorer/target.h>
+#include <utils/environment.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+using namespace ProjectExplorer;
+
+namespace Constants {
+const QLatin1String BUILDCONSOLE_AVOIDLOCAL("IncrediBuild.BuildConsole.AvoidLocal");
+const QLatin1String BUILDCONSOLE_PROFILEXML("IncrediBuild.BuildConsole.ProfileXml");
+const QLatin1String BUILDCONSOLE_MAXCPU("IncrediBuild.BuildConsole.MaxCpu");
+const QLatin1String BUILDCONSOLE_MAXWINVER("IncrediBuild.BuildConsole.MaxWinVer");
+const QLatin1String BUILDCONSOLE_MINWINVER("IncrediBuild.BuildConsole.MinWinVer");
+const QLatin1String BUILDCONSOLE_TITLE("IncrediBuild.BuildConsole.Title");
+const QLatin1String BUILDCONSOLE_MONFILE("IncrediBuild.BuildConsole.MonFile");
+const QLatin1String BUILDCONSOLE_SUPPRESSSTDOUT("IncrediBuild.BuildConsole.SuppressStdOut");
+const QLatin1String BUILDCONSOLE_LOGFILE("IncrediBuild.BuildConsole.LogFile");
+const QLatin1String BUILDCONSOLE_SHOWCMD("IncrediBuild.BuildConsole.ShowCmd");
+const QLatin1String BUILDCONSOLE_SHOWAGENTS("IncrediBuild.BuildConsole.ShowAgents");
+const QLatin1String BUILDCONSOLE_SHOWTIME("IncrediBuild.BuildConsole.ShowTime");
+const QLatin1String BUILDCONSOLE_HIDEHEADER("IncrediBuild.BuildConsole.HideHeader");
+const QLatin1String BUILDCONSOLE_LOGLEVEL("IncrediBuild.BuildConsole.LogLevel");
+const QLatin1String BUILDCONSOLE_SETENV("IncrediBuild.BuildConsole.SetEnv");
+const QLatin1String BUILDCONSOLE_STOPONERROR("IncrediBuild.BuildConsole.StopOnError");
+const QLatin1String BUILDCONSOLE_ADDITIONALARGUMENTS("IncrediBuild.BuildConsole.AdditionalArguments");
+const QLatin1String BUILDCONSOLE_OPENMONITOR("IncrediBuild.BuildConsole.OpenMonitor");
+const QLatin1String BUILDCONSOLE_KEEPJOBNUM("IncrediBuild.BuildConsole.KeepJobNum");
+const QLatin1String BUILDCONSOLE_COMMANDBUILDER("IncrediBuild.BuildConsole.CommandBuilder");
+}
+
+BuildConsoleBuildStep::BuildConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList,
+ Core::Id id)
+ : ProjectExplorer::AbstractProcessStep(buildStepList, id)
+ , m_earlierSteps(buildStepList)
+{
+ setDisplayName("IncrediBuild for Windows");
+ initCommandBuilders();
+}
+
+BuildConsoleBuildStep::~BuildConsoleBuildStep()
+{
+ qDeleteAll(m_commandBuildersList);
+}
+
+void BuildConsoleBuildStep::tryToMigrate()
+{
+ // This constructor is called when creating a fresh build step.
+ // Attempt to detect build system from pre-existing steps.
+ for (CommandBuilder* p : m_commandBuildersList) {
+ if (p->canMigrate(m_earlierSteps)) {
+ m_activeCommandBuilder = p;
+ break;
+ }
+ }
+}
+
+void BuildConsoleBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
+{
+ formatter->addLineParser(new GnuMakeParser());
+ formatter->addLineParsers(target()->kit()->createOutputParsers());
+ formatter->addSearchDir(processParameters()->effectiveWorkingDirectory());
+ AbstractProcessStep::setupOutputFormatter(formatter);
+}
+
+bool BuildConsoleBuildStep::fromMap(const QVariantMap &map)
+{
+ m_loadedFromMap = true;
+ m_avoidLocal = map.value(Constants::BUILDCONSOLE_AVOIDLOCAL, QVariant(false)).toBool();
+ m_profileXml = map.value(Constants::BUILDCONSOLE_PROFILEXML, QVariant(QString())).toString();
+ m_maxCpu = map.value(Constants::BUILDCONSOLE_MAXCPU, QVariant(0)).toInt();
+ m_maxWinVer = map.value(Constants::BUILDCONSOLE_MAXWINVER, QVariant(QString())).toString();
+ m_minWinVer = map.value(Constants::BUILDCONSOLE_MINWINVER, QVariant(QString())).toString();
+ m_title = map.value(Constants::BUILDCONSOLE_TITLE, QVariant(QString())).toString();
+ m_monFile = map.value(Constants::BUILDCONSOLE_MONFILE, QVariant(QString())).toString();
+ m_suppressStdOut = map.value(Constants::BUILDCONSOLE_SUPPRESSSTDOUT, QVariant(false)).toBool();
+ m_logFile = map.value(Constants::BUILDCONSOLE_LOGFILE, QVariant(QString())).toString();
+ m_showCmd = map.value(Constants::BUILDCONSOLE_SHOWCMD, QVariant(false)).toBool();
+ m_showAgents = map.value(Constants::BUILDCONSOLE_SHOWAGENTS, QVariant(false)).toBool();
+ m_showTime = map.value(Constants::BUILDCONSOLE_SHOWTIME, QVariant(false)).toBool();
+ m_hideHeader = map.value(Constants::BUILDCONSOLE_HIDEHEADER, QVariant(false)).toBool();
+ m_logLevel = map.value(Constants::BUILDCONSOLE_LOGLEVEL, QVariant(QString())).toString();
+ m_setEnv = map.value(Constants::BUILDCONSOLE_SETENV, QVariant(QString())).toString();
+ m_stopOnError = map.value(Constants::BUILDCONSOLE_STOPONERROR, QVariant(false)).toBool();
+ m_additionalArguments = map.value(Constants::BUILDCONSOLE_ADDITIONALARGUMENTS, QVariant(QString())).toString();
+ m_openMonitor = map.value(Constants::BUILDCONSOLE_OPENMONITOR, QVariant(false)).toBool();
+ m_keepJobNum = map.value(Constants::BUILDCONSOLE_KEEPJOBNUM, QVariant(false)).toBool();
+
+ // Command builder. Default to the first in list, which should be the "Custom Command"
+ commandBuilder(map.value(Constants::BUILDCONSOLE_COMMANDBUILDER,
+ QVariant(m_commandBuildersList.front()->displayName()))
+ .toString());
+ bool result = m_activeCommandBuilder->fromMap(map);
+
+ return result && AbstractProcessStep::fromMap(map);
+}
+
+QVariantMap BuildConsoleBuildStep::toMap() const
+{
+ QVariantMap map = AbstractProcessStep::toMap();
+
+ map[IncrediBuild::Constants::INCREDIBUILD_BUILDSTEP_TYPE] = QVariant(
+ IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID);
+ map[Constants::BUILDCONSOLE_AVOIDLOCAL] = QVariant(m_avoidLocal);
+ map[Constants::BUILDCONSOLE_PROFILEXML] = QVariant(m_profileXml);
+ map[Constants::BUILDCONSOLE_MAXCPU] = QVariant(m_maxCpu);
+ map[Constants::BUILDCONSOLE_MAXWINVER] = QVariant(m_maxWinVer);
+ map[Constants::BUILDCONSOLE_MINWINVER] = QVariant(m_minWinVer);
+ map[Constants::BUILDCONSOLE_TITLE] = QVariant(m_title);
+ map[Constants::BUILDCONSOLE_MONFILE] = QVariant(m_monFile);
+ map[Constants::BUILDCONSOLE_SUPPRESSSTDOUT] = QVariant(m_suppressStdOut);
+ map[Constants::BUILDCONSOLE_LOGFILE] = QVariant(m_logFile);
+ map[Constants::BUILDCONSOLE_SHOWCMD] = QVariant(m_showCmd);
+ map[Constants::BUILDCONSOLE_SHOWAGENTS] = QVariant(m_showAgents);
+ map[Constants::BUILDCONSOLE_SHOWTIME] = QVariant(m_showTime);
+ map[Constants::BUILDCONSOLE_HIDEHEADER] = QVariant(m_hideHeader);
+ map[Constants::BUILDCONSOLE_LOGLEVEL] = QVariant(m_logLevel);
+ map[Constants::BUILDCONSOLE_SETENV] = QVariant(m_setEnv);
+ map[Constants::BUILDCONSOLE_STOPONERROR] = QVariant(m_stopOnError);
+ map[Constants::BUILDCONSOLE_ADDITIONALARGUMENTS] = QVariant(m_additionalArguments);
+ map[Constants::BUILDCONSOLE_OPENMONITOR] = QVariant(m_openMonitor);
+ map[Constants::BUILDCONSOLE_KEEPJOBNUM] = QVariant(m_keepJobNum);
+ map[Constants::BUILDCONSOLE_COMMANDBUILDER] = QVariant(m_activeCommandBuilder->displayName());
+
+ m_activeCommandBuilder->toMap(&map);
+
+ return map;
+}
+
+const QStringList& BuildConsoleBuildStep::supportedWindowsVersions() const
+{
+ static QStringList list({QString(),
+ "Windows 7",
+ "Windows 8",
+ "Windows 10",
+ "Windows Vista",
+ "Windows XP",
+ "Windows Server 2003",
+ "Windows Server 2008",
+ "Windows Server 2012"});
+ return list;
+}
+
+QString BuildConsoleBuildStep::normalizeWinVerArgument(QString winVer)
+{
+ winVer.remove("Windows ");
+ winVer.remove("Server ");
+ return winVer.toUpper();
+}
+
+const QStringList& BuildConsoleBuildStep::supportedLogLevels() const
+{
+ static QStringList list({ QString(), "Minimal", "Extended", "Detailed"});
+ return list;
+}
+
+bool BuildConsoleBuildStep::init()
+{
+ QStringList args;
+
+ m_activeCommandBuilder->keepJobNum(m_keepJobNum);
+ QString cmd("/Command= %0");
+ cmd = cmd.arg(m_activeCommandBuilder->fullCommandFlag());
+ args.append(cmd);
+
+ if (!m_profileXml.isEmpty())
+ args.append(QString("/Profile=" + m_profileXml));
+
+ args.append(QString("/AvoidLocal=%1").arg(m_avoidLocal ? QString("ON") : QString("OFF")));
+
+ if (m_maxCpu > 0)
+ args.append(QString("/MaxCPUs=%1").arg(m_maxCpu));
+
+ if (!m_maxWinVer.isEmpty())
+ args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(m_maxWinVer)));
+
+ if (!m_minWinVer.isEmpty())
+ args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(m_minWinVer)));
+
+ if (!m_title.isEmpty())
+ args.append(QString("/Title=" + m_title));
+
+ if (!m_monFile.isEmpty())
+ args.append(QString("/Mon=" + m_monFile));
+
+ if (m_suppressStdOut)
+ args.append("/Silent");
+
+ if (!m_logFile.isEmpty())
+ args.append(QString("/Log=" + m_logFile));
+
+ if (m_showCmd)
+ args.append("/ShowCmd");
+
+ if (m_showAgents)
+ args.append("/ShowAgent");
+
+ if (m_showAgents)
+ args.append("/ShowTime");
+
+ if (m_hideHeader)
+ args.append("/NoLogo");
+
+ if (!m_logLevel.isEmpty())
+ args.append(QString("/LogLevel=" + m_logLevel));
+
+ if (!m_setEnv.isEmpty())
+ args.append(QString("/SetEnv=" + m_setEnv));
+
+ if (m_stopOnError)
+ args.append("/StopOnErrors");
+
+ if (!m_additionalArguments.isEmpty())
+ args.append(m_additionalArguments);
+
+ if (m_openMonitor)
+ args.append("/OpenMonitor");
+
+ Utils::CommandLine cmdLine("BuildConsole.exe", args);
+ ProcessParameters* procParams = processParameters();
+ procParams->setCommandLine(cmdLine);
+ procParams->setEnvironment(Utils::Environment::systemEnvironment());
+
+ BuildConfiguration *buildConfig = buildConfiguration();
+ if (buildConfig) {
+ procParams->setWorkingDirectory(buildConfig->buildDirectory());
+ procParams->setEnvironment(buildConfig->environment());
+
+ Utils::MacroExpander *macroExpander = buildConfig->macroExpander();
+ if (macroExpander)
+ procParams->setMacroExpander(macroExpander);
+ }
+
+ return AbstractProcessStep::init();
+}
+
+BuildStepConfigWidget* BuildConsoleBuildStep::createConfigWidget()
+{
+ return new BuildConsoleStepConfigWidget(this);
+}
+
+void BuildConsoleBuildStep::initCommandBuilders()
+{
+ if (m_commandBuildersList.empty()) {
+ // "Custom Command"- needs to be first in the list.
+ m_commandBuildersList.push_back(new CommandBuilder(this));
+ m_commandBuildersList.push_back(new MakeCommandBuilder(this));
+ m_commandBuildersList.push_back(new CMakeCommandBuilder(this));
+ }
+
+ // Default to "Custom Command".
+ if (!m_activeCommandBuilder)
+ m_activeCommandBuilder = m_commandBuildersList.front();
+}
+
+const QStringList& BuildConsoleBuildStep::supportedCommandBuilders()
+{
+ static QStringList list;
+ if (list.empty()) {
+ initCommandBuilders();
+ for (CommandBuilder* p : m_commandBuildersList)
+ list.push_back(p->displayName());
+ }
+
+ return list;
+}
+
+void BuildConsoleBuildStep::commandBuilder(const QString& commandBuilder)
+{
+ for (CommandBuilder* p : m_commandBuildersList) {
+ if (p->displayName().compare(commandBuilder) == 0) {
+ m_activeCommandBuilder = p;
+ break;
+ }
+ }
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/buildconsolebuildstep.h b/src/plugins/incredibuild/buildconsolebuildstep.h
new file mode 100644
index 00000000000..0c8745404db
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolebuildstep.h
@@ -0,0 +1,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, Core::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
diff --git a/src/plugins/incredibuild/buildconsolebuildstep.ui b/src/plugins/incredibuild/buildconsolebuildstep.ui
new file mode 100644
index 00000000000..a710d86ebb1
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolebuildstep.ui
@@ -0,0 +1,356 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>IncrediBuild::Internal::BuildConsoleBuildStep</class>
+ <widget class="QWidget" name="IncrediBuild::Internal::BuildConsoleBuildStep">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>941</width>
+ <height>624</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="22" column="1">
+ <widget class="Utils::PathChooser" name="logFilePathChooser" native="true"/>
+ </item>
+ <item row="20" column="1">
+ <widget class="Utils::PathChooser" name="monFilePathChooser" native="true"/>
+ </item>
+ <item row="4" column="1">
+ <widget class="Utils::PathChooser" name="makePathChooser" native="true"/>
+ </item>
+ <item row="11" column="1">
+ <widget class="Utils::PathChooser" name="profileXmlPathChooser" native="true"/>
+ </item>
+ <item row="28" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Miscellaneous</string>
+ </property>
+ </widget>
+ </item>
+ <item row="16" column="0">
+ <widget class="QLabel" name="newestOsLabel">
+ <property name="toolTip">
+ <string>Specifies the newest operating system installed on a helper machine to be allowed to participate as helper in the build.</string>
+ </property>
+ <property name="text">
+ <string>Newest allowed helper machine OS:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>IncrediBuild Distribution control</string>
+ </property>
+ </widget>
+ </item>
+ <item row="17" column="0">
+ <widget class="QLabel" name="oldestOsLabel">
+ <property name="toolTip">
+ <string>Specifies the oldest operating system installed on a helper machine to be allowed to participate as helper in the build.</string>
+ </property>
+ <property name="text">
+ <string>Oldest allowed helper machine OS:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="19" column="1">
+ <widget class="QLineEdit" name="titleEdit"/>
+ </item>
+ <item row="19" column="0">
+ <widget class="QLabel" name="titleLabel">
+ <property name="toolTip">
+ <string>Specifies a custom header line which will be displayed in the beginning of the build output text. This title will also be used for the Build History and Build Monitor displays.</string>
+ </property>
+ <property name="text">
+ <string>Build Title:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target and configuration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="22" column="0">
+ <widget class="QLabel" name="logFileLabel">
+ <property name="toolTip">
+ <string>Writes build output to a file</string>
+ </property>
+ <property name="text">
+ <string>Output Log file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="20" column="0">
+ <widget class="QLabel" name="monFileLabel">
+ <property name="toolTip">
+ <string>Writes a copy of the build progress (.ib_mon) file to the specified location. - If only a folder name is given, IncrediBuild generates a GUID for the file name. - A message containing the location of the saved .ib_mon file is added to the end of the build output</string>
+ </property>
+ <property name="text">
+ <string>Save IncrediBuild monitor file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="makeLabel">
+ <property name="text">
+ <string>Make command:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="16" column="1">
+ <widget class="QComboBox" name="newestWindowsOs"/>
+ </item>
+ <item row="15" column="1">
+ <widget class="QSpinBox" name="maxCpuSpin">
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="singleStep">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="24" column="0">
+ <widget class="QCheckBox" name="showAgents">
+ <property name="toolTip">
+ <string>Shows the Agent used to build each file</string>
+ </property>
+ <property name="text">
+ <string>Show Agents in output</string>
+ </property>
+ </widget>
+ </item>
+ <item row="15" column="0">
+ <widget class="QLabel" name="maxCpuLabel">
+ <property name="toolTip">
+ <string>Determines the maximum number of CPU cores that can be used in a build, regardless of the number of available Agents. It takes into account both local and remote cores, even if the Avoid Task Execution on Local Machine option is selected.</string>
+ </property>
+ <property name="text">
+ <string>Maximum CPUs to utilize in the build:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="makeArgumentsLabel">
+ <property name="text">
+ <string>Make arguments:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="30" column="0">
+ <widget class="QCheckBox" name="stopOnError">
+ <property name="toolTip">
+ <string>When specified, the execution will stop as soon as an error is encountered. This is the default behavior in 'Visual Studio' builds, but not the default for 'Make and Build tools' or 'Dev Tools' builds</string>
+ </property>
+ <property name="text">
+ <string>Stop On Errors</string>
+ </property>
+ </widget>
+ </item>
+ <item row="18" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Output and Logging</string>
+ </property>
+ </widget>
+ </item>
+ <item row="11" column="0">
+ <widget class="QLabel" name="profileXmlLabel">
+ <property name="toolTip">
+ <string>The Profile XML file is used to define how Automatic Interception Interface should handle the various processes involved in a distributed job. It is not necessary for 'Visual Studio' or 'Make and Build tools' builds, but can be used to provide configuration options if those builds use additional processes that are not included in those packages. it is required to configure distributable processes in 'Dev Tools' builds.</string>
+ </property>
+ <property name="text">
+ <string>Profile.xml:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="17" column="1">
+ <widget class="QComboBox" name="oldestWindowsOs"/>
+ </item>
+ <item row="12" column="0">
+ <widget class="QCheckBox" name="avoidLocal">
+ <property name="toolTip">
+ <string>Overrides the Agent Settings dialog Avoid task execution on local machine when possible option. This allows to free more resources on the initiator machine and could be beneficial to distribution in scenarios where the initiating machine is bottlenecking the build with High CPU usage</string>
+ </property>
+ <property name="text">
+ <string>Avoid Local</string>
+ </property>
+ </widget>
+ </item>
+ <item row="21" column="0">
+ <widget class="QCheckBox" name="suppressStdOut">
+ <property name="toolTip">
+ <string>Does not write anything to the standard output</string>
+ </property>
+ <property name="text">
+ <string>Suppress STDOUT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="makeArgumentsLineEdit"/>
+ </item>
+ <item row="27" column="1">
+ <widget class="QComboBox" name="logLevel"/>
+ </item>
+ <item row="32" column="0">
+ <widget class="QCheckBox" name="openMonitor">
+ <property name="toolTip">
+ <string>Opens an IncrediBuild Build Monitor that graphically displays the build’s progress once the build starts.</string>
+ </property>
+ <property name="text">
+ <string>Open Monitor</string>
+ </property>
+ </widget>
+ </item>
+ <item row="29" column="1">
+ <widget class="QLineEdit" name="setEnvEdit"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label">
+ <property name="toolTip">
+ <string>Select an helper to establish the build command.</string>
+ </property>
+ <property name="text">
+ <string>Command Helper:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="31" column="0">
+ <widget class="QLabel" name="setEnvLabel">
+ <property name="toolTip">
+ <string>Add additional buildconsole arguments manually. The value of this field will be concatenated to the final buildconsole command line</string>
+ </property>
+ <property name="text">
+ <string>Additional Arguments:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="2">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic; color:#ff0000;&quot;&gt;Please enter the appropriate arguments to your build command.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="29" column="0">
+ <widget class="QLabel" name="setEnvLabel">
+ <property name="toolTip">
+ <string>Sets or overrides environment variables for the context of the build</string>
+ </property>
+ <property name="text">
+ <string>Set an Environment Variable:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="commandBuilder"/>
+ </item>
+ <item row="8" column="0">
+ <widget class="QCheckBox" name="keepJobsNum">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Setting this option to true, forces IncrediBuild to not override the -j command line switch. &lt;/p&gt;&lt;p&gt;The default IncrediBuild behavior is to set a high value to the -j command line switch which controls the number of processes that the build tools executed by QT will execute in parallel (the default IncrediBuild behavior will set this value to 200).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="text">
+ <string>Keep Original Jobs Num</string>
+ </property>
+ </widget>
+ </item>
+ <item row="31" column="1">
+ <widget class="QLineEdit" name="additionalArgsEdit"/>
+ </item>
+ <item row="27" column="0">
+ <widget class="QLabel" name="logLevelLabel">
+ <property name="toolTip">
+ <string>Overrides the internal Incredibuild logging level for this build. Does not affect output or any user accessible logging. Used mainly to troubleshoot issues with the help of IncrediBuild support</string>
+ </property>
+ <property name="text">
+ <string>Internal IncrediBuild logging level:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="25" column="0">
+ <widget class="QCheckBox" name="showTime">
+ <property name="toolTip">
+ <string>Shows the Start and Finish time for each file built</string>
+ </property>
+ <property name="text">
+ <string>Show Time in output</string>
+ </property>
+ </widget>
+ </item>
+ <item row="23" column="0">
+ <widget class="QCheckBox" name="showCmd">
+ <property name="toolTip">
+ <string>Shows, for each file built, the command-line used by IncrediBuild to build the file</string>
+ </property>
+ <property name="text">
+ <string>Show Commands in output</string>
+ </property>
+ </widget>
+ </item>
+ <item row="26" column="0">
+ <widget class="QCheckBox" name="hideHeader">
+ <property name="toolTip">
+ <string>Suppresses the 'IncrediBuild' header in the build output</string>
+ </property>
+ <property name="text">
+ <string>Hide IncrediBuild Header in output</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" colspan="2">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic; color:#ff0000;&quot;&gt;Please make sure the build command's multi-job parameter value is large enough (such as -J200 for the JOM or Make build tools)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/incredibuild/buildconsolestepconfigwidget.cpp b/src/plugins/incredibuild/buildconsolestepconfigwidget.cpp
new file mode 100644
index 00000000000..4e5b43aff4e
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolestepconfigwidget.cpp
@@ -0,0 +1,297 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "buildconsolestepconfigwidget.h"
+
+#include "ui_buildconsolebuildstep.h"
+
+#include <coreplugin/variablechooser.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+BuildConsoleStepConfigWidget::BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep)
+ : ProjectExplorer::BuildStepConfigWidget(buildConsoleStep)
+ , m_buildStepUI(nullptr)
+ , m_buildStep(buildConsoleStep)
+{
+ // On first creation of the step, attempt to detect and migrate from preceding steps
+ if (!buildConsoleStep->loadedFromMap())
+ buildConsoleStep->tryToMigrate();
+
+ m_buildStepUI = new Ui_BuildConsoleBuildStep();
+ m_buildStepUI->setupUi(this);
+ Core::VariableChooser::addSupportForChildWidgets(this, buildConsoleStep->macroExpander());
+
+ m_buildStepUI->commandBuilder->addItems(m_buildStep->supportedCommandBuilders());
+ m_buildStepUI->commandBuilder->setCurrentText(m_buildStep->commandBuilder()->displayName());
+ connect(m_buildStepUI->commandBuilder, &QComboBox::currentTextChanged, this, &BuildConsoleStepConfigWidget::commandBuilderChanged);
+
+ QString command, defaultCommand;
+ defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
+ m_buildStepUI->makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
+ command = m_buildStep->commandBuilder()->command();
+ if (command != defaultCommand)
+ m_buildStepUI->makePathChooser->setPath(command);
+
+ m_buildStepUI->makePathChooser->setExpectedKind(Utils::PathChooser::Kind::ExistingCommand);
+ m_buildStepUI->makePathChooser->setBaseDirectory(Utils::FilePath::fromString(Utils::PathChooser::homePath()));
+ m_buildStepUI->makePathChooser->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MakeCommand.History"));
+ connect(m_buildStepUI->makePathChooser, &Utils::PathChooser::rawPathChanged, this, &BuildConsoleStepConfigWidget::makePathEdited);
+
+ QString defaultArgs;
+ for (const QString &a : m_buildStep->commandBuilder()->defaultArguments())
+ defaultArgs += "\"" + a + "\" ";
+
+ QString args;
+ for (const QString &a : m_buildStep->commandBuilder()->arguments())
+ args += "\"" + a + "\" ";
+
+ m_buildStepUI->makeArgumentsLineEdit->setPlaceholderText(defaultArgs);
+ if (args != defaultArgs)
+ m_buildStepUI->makeArgumentsLineEdit->setText(args);
+
+ connect(m_buildStepUI->makeArgumentsLineEdit, &QLineEdit::textEdited, this, &BuildConsoleStepConfigWidget::commandArgsChanged);
+
+ m_buildStepUI->avoidLocal->setChecked(m_buildStep->avoidLocal());
+ connect(m_buildStepUI->avoidLocal, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::avoidLocalChanged);
+
+ m_buildStepUI->profileXmlPathChooser->setExpectedKind(Utils::PathChooser::Kind::File);
+ m_buildStepUI->profileXmlPathChooser->setBaseDirectory(Utils::FilePath::fromString(Utils::PathChooser::homePath()));
+ m_buildStepUI->profileXmlPathChooser->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.ProfileXml.History"));
+ m_buildStepUI->profileXmlPathChooser->setPath(m_buildStep->profileXml());
+ connect(m_buildStepUI->profileXmlPathChooser, &Utils::PathChooser::rawPathChanged, this, &BuildConsoleStepConfigWidget::profileXmlEdited);
+
+ m_buildStepUI->maxCpuSpin->setValue(m_buildStep->maxCpu());
+ connect(m_buildStepUI->maxCpuSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &BuildConsoleStepConfigWidget::maxCpuChanged);
+
+ m_buildStepUI->newestWindowsOs->addItems(m_buildStep->supportedWindowsVersions());
+ m_buildStepUI->newestWindowsOs->setCurrentText(m_buildStep->maxWinVer());
+ connect(m_buildStepUI->newestWindowsOs, &QComboBox::currentTextChanged, this, &BuildConsoleStepConfigWidget::maxWinVerChanged);
+
+ m_buildStepUI->oldestWindowsOs->addItems(m_buildStep->supportedWindowsVersions());
+ m_buildStepUI->oldestWindowsOs->setCurrentText(m_buildStep->minWinVer());
+ connect(m_buildStepUI->oldestWindowsOs, &QComboBox::currentTextChanged, this, &BuildConsoleStepConfigWidget::minWinVerChanged);
+
+ m_buildStepUI->titleEdit->setText(m_buildStep->title());
+ connect(m_buildStepUI->titleEdit, &QLineEdit::textEdited, this, &BuildConsoleStepConfigWidget::titleEdited);
+
+ m_buildStepUI->monFilePathChooser->setExpectedKind(Utils::PathChooser::Kind::Any);
+ m_buildStepUI->monFilePathChooser->setBaseDirectory(Utils::FilePath::fromString(Utils::PathChooser::homePath()));
+ m_buildStepUI->monFilePathChooser->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History"));
+ m_buildStepUI->monFilePathChooser->setPath(m_buildStep->monFile());
+ connect(m_buildStepUI->monFilePathChooser, &Utils::PathChooser::rawPathChanged, this, &BuildConsoleStepConfigWidget::monFileEdited);
+
+ m_buildStepUI->suppressStdOut->setChecked(m_buildStep->suppressStdOut());
+ connect(m_buildStepUI->suppressStdOut, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::suppressStdOutChanged);
+
+ m_buildStepUI->logFilePathChooser->setExpectedKind(Utils::PathChooser::Kind::SaveFile);
+ m_buildStepUI->logFilePathChooser->setBaseDirectory(Utils::FilePath::fromString(Utils::PathChooser::homePath()));
+ m_buildStepUI->logFilePathChooser->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History"));
+ m_buildStepUI->logFilePathChooser->setPath(m_buildStep->logFile());
+ connect(m_buildStepUI->logFilePathChooser, &Utils::PathChooser::rawPathChanged, this, &BuildConsoleStepConfigWidget::logFileEdited);
+
+ m_buildStepUI->showCmd->setChecked(m_buildStep->showCmd());
+ connect(m_buildStepUI->showCmd, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::showCmdChanged);
+
+ m_buildStepUI->showAgents->setChecked(m_buildStep->showAgents());
+ connect(m_buildStepUI->showAgents, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::showAgentsChanged);
+
+ m_buildStepUI->showTime->setChecked(m_buildStep->showTime());
+ connect(m_buildStepUI->showTime, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::showTimeChanged);
+
+ m_buildStepUI->hideHeader->setChecked(m_buildStep->hideHeader());
+ connect(m_buildStepUI->hideHeader, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::hideHeaderChanged);
+
+ m_buildStepUI->logLevel->addItems(m_buildStep->supportedLogLevels());
+ m_buildStepUI->logLevel->setCurrentText(m_buildStep->logLevel());
+ connect(m_buildStepUI->logLevel, &QComboBox::currentTextChanged, this, &BuildConsoleStepConfigWidget::logLevelChanged);
+
+ m_buildStepUI->setEnvEdit->setText(m_buildStep->setEnv());
+ connect(m_buildStepUI->setEnvEdit, &QLineEdit::textEdited, this, &BuildConsoleStepConfigWidget::setEnvChanged);
+
+ m_buildStepUI->stopOnError->setChecked(m_buildStep->stopOnError());
+ connect(m_buildStepUI->stopOnError, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::stopOnErrorChanged);
+
+ m_buildStepUI->additionalArgsEdit->setText(m_buildStep->additionalArguments());
+ connect(m_buildStepUI->additionalArgsEdit, &QLineEdit::textEdited, this, &BuildConsoleStepConfigWidget::additionalArgsChanged);
+
+ m_buildStepUI->openMonitor->setChecked(m_buildStep->openMonitor());
+ connect(m_buildStepUI->openMonitor, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::openMonitorChanged);
+
+ m_buildStepUI->keepJobsNum->setChecked(m_buildStep->keepJobNum());
+ connect(m_buildStepUI->keepJobsNum, &QCheckBox::stateChanged, this, &BuildConsoleStepConfigWidget::keepJobNumChanged);
+}
+
+BuildConsoleStepConfigWidget::~BuildConsoleStepConfigWidget()
+{
+ delete m_buildStepUI;
+ m_buildStepUI = nullptr;
+}
+
+QString BuildConsoleStepConfigWidget::displayName() const
+{
+ return tr("IncrediBuild for Windows");
+}
+
+QString BuildConsoleStepConfigWidget::summaryText() const
+{
+ return "<b>" + displayName() + "</b>";
+}
+
+void BuildConsoleStepConfigWidget::avoidLocalChanged()
+{
+ m_buildStep->avoidLocal(m_buildStepUI->avoidLocal->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::profileXmlEdited()
+{
+ m_buildStep->profileXml(m_buildStepUI->profileXmlPathChooser->rawPath());
+}
+
+void BuildConsoleStepConfigWidget::maxCpuChanged(int)
+{
+ m_buildStep->maxCpu(m_buildStepUI->maxCpuSpin->value());
+}
+
+void BuildConsoleStepConfigWidget::maxWinVerChanged(const QString &)
+{
+ m_buildStep->maxWinVer(m_buildStepUI->newestWindowsOs->currentText());
+}
+
+void BuildConsoleStepConfigWidget::minWinVerChanged(const QString &)
+{
+ m_buildStep->minWinVer(m_buildStepUI->oldestWindowsOs->currentText());
+}
+
+void BuildConsoleStepConfigWidget::titleEdited(const QString &)
+{
+ m_buildStep->title(m_buildStepUI->titleEdit->text());
+}
+
+void BuildConsoleStepConfigWidget::monFileEdited()
+{
+ m_buildStep->monFile(m_buildStepUI->monFilePathChooser->rawPath());
+}
+
+void BuildConsoleStepConfigWidget::suppressStdOutChanged()
+{
+ m_buildStep->suppressStdOut(m_buildStepUI->suppressStdOut->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::logFileEdited()
+{
+ m_buildStep->logFile(m_buildStepUI->logFilePathChooser->rawPath());
+}
+
+void BuildConsoleStepConfigWidget::showCmdChanged()
+{
+ m_buildStep->showCmd(m_buildStepUI->showCmd->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::showAgentsChanged()
+{
+ m_buildStep->showAgents(m_buildStepUI->showAgents->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::showTimeChanged()
+{
+ m_buildStep->showTime(m_buildStepUI->showTime->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::hideHeaderChanged()
+{
+ m_buildStep->hideHeader(m_buildStepUI->hideHeader->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::logLevelChanged(const QString&)
+{
+ m_buildStep->logLevel(m_buildStepUI->logLevel->currentText());
+}
+
+void BuildConsoleStepConfigWidget::setEnvChanged(const QString&)
+{
+ m_buildStep->setEnv(m_buildStepUI->setEnvEdit->text());
+}
+
+void BuildConsoleStepConfigWidget::stopOnErrorChanged()
+{
+ m_buildStep->stopOnError(m_buildStepUI->stopOnError->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::additionalArgsChanged(const QString&)
+{
+ m_buildStep->additionalArguments(m_buildStepUI->additionalArgsEdit->text());
+}
+
+void BuildConsoleStepConfigWidget::openMonitorChanged()
+{
+ m_buildStep->openMonitor(m_buildStepUI->openMonitor->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::keepJobNumChanged()
+{
+ m_buildStep->keepJobNum(m_buildStepUI->keepJobsNum->checkState() == Qt::CheckState::Checked);
+}
+
+void BuildConsoleStepConfigWidget::commandBuilderChanged(const QString &)
+{
+ m_buildStep->commandBuilder(m_buildStepUI->commandBuilder->currentText());
+
+ QString defaultArgs;
+ for (const QString &a : m_buildStep->commandBuilder()->defaultArguments())
+ defaultArgs += "\"" + a + "\" ";
+
+ QString args;
+ for (const QString &a : m_buildStep->commandBuilder()->arguments())
+ args += "\"" + a + "\" ";
+
+ if (args != defaultArgs)
+ m_buildStepUI->makeArgumentsLineEdit->setText(args);
+ else
+ m_buildStepUI->makeArgumentsLineEdit->setText(QString());
+
+ QString command, defaultCommand;
+ defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
+ m_buildStepUI->makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
+ command = m_buildStep->commandBuilder()->command();
+ if (command != defaultCommand)
+ m_buildStepUI->makePathChooser->setPath(command);
+ else
+ m_buildStepUI->makePathChooser->setPath("");
+}
+
+void BuildConsoleStepConfigWidget::commandArgsChanged(const QString &)
+{
+ m_buildStep->commandBuilder()->arguments(m_buildStepUI->makeArgumentsLineEdit->text());
+}
+
+void BuildConsoleStepConfigWidget::makePathEdited()
+{
+ m_buildStep->commandBuilder()->command(m_buildStepUI->makePathChooser->rawPath());
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/buildconsolestepconfigwidget.h b/src/plugins/incredibuild/buildconsolestepconfigwidget.h
new file mode 100644
index 00000000000..b306bd72097
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolestepconfigwidget.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** 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 "buildconsolebuildstep.h"
+
+#include <projectexplorer/buildstep.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class Ui_BuildConsoleBuildStep;
+
+class BuildConsoleStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep);
+ virtual ~BuildConsoleStepConfigWidget();
+
+ QString displayName() const;
+ QString summaryText() const;
+
+private:
+ void avoidLocalChanged();
+ void profileXmlEdited();
+ void maxCpuChanged(int);
+ void maxWinVerChanged(const QString&);
+ void minWinVerChanged(const QString&);
+ void titleEdited(const QString&);
+ void monFileEdited();
+ void suppressStdOutChanged();
+ void logFileEdited();
+ void showCmdChanged();
+ void showAgentsChanged();
+ void showTimeChanged();
+ void hideHeaderChanged();
+ void logLevelChanged(const QString&);
+ void setEnvChanged(const QString&);
+ void stopOnErrorChanged();
+ void additionalArgsChanged(const QString&);
+ void openMonitorChanged();
+ void keepJobNumChanged();
+ void commandBuilderChanged(const QString&);
+ void commandArgsChanged(const QString&);
+ void makePathEdited();
+
+ Internal::Ui_BuildConsoleBuildStep *m_buildStepUI;
+ BuildConsoleBuildStep *m_buildStep;
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/buildconsolestepfactory.cpp b/src/plugins/incredibuild/buildconsolestepfactory.cpp
new file mode 100644
index 00000000000..d855cc9f5a7
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolestepfactory.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "buildconsolestepfactory.h"
+
+#include "buildconsolebuildstep.h"
+#include "incredibuildconstants.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/toolchainmanager.h>
+
+#include <QMessageBox>
+
+using namespace ProjectExplorer;
+
+namespace IncrediBuild {
+namespace Internal {
+
+BuildConsoleStepFactory::BuildConsoleStepFactory()
+{
+ registerStep<BuildConsoleBuildStep>(Constants::BUILDCONSOLE_BUILDSTEP_ID);
+ setDisplayName(QObject::tr("IncrediBuild for Windows"));
+ setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
+ ProjectExplorer::Constants::BUILDSTEPS_CLEAN});
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/buildconsolestepfactory.h b/src/plugins/incredibuild/buildconsolestepfactory.h
new file mode 100644
index 00000000000..b7e56993d3d
--- /dev/null
+++ b/src/plugins/incredibuild/buildconsolestepfactory.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** 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 <projectexplorer/abi.h>
+#include <projectexplorer/abstractprocessstep.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/target.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class BuildConsoleStepFactory : public ProjectExplorer::BuildStepFactory
+{
+public:
+ BuildConsoleStepFactory();
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/cmakecommandbuilder.cpp b/src/plugins/incredibuild/cmakecommandbuilder.cpp
new file mode 100644
index 00000000000..91d8a2901cd
--- /dev/null
+++ b/src/plugins/incredibuild/cmakecommandbuilder.cpp
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "cmakecommandbuilder.h"
+
+#include <coreplugin/icore.h>
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/project.h>
+
+#include <QFileInfo>
+#include <QMessageBox>
+#include <QRegExp>
+#include <QStandardPaths>
+
+using namespace ProjectExplorer;
+
+namespace IncrediBuild {
+namespace Internal {
+
+bool CMakeCommandBuilder::canMigrate(BuildStepList *buildStepList)
+{
+ // "Make"
+ QString makeClassName("CMakeProjectManager::Internal::CMakeBuildStep");
+ for (int i = buildStepList->count() - 1; i >= 0; --i) {
+ QString className = QString::fromUtf8(buildStepList->at(i)->metaObject()->className());
+ if (className.compare(makeClassName) == 0) {
+ buildStepList->at(i)->setEnabled(false);
+ buildStepList->at(i)->projectConfiguration()->project()->saveSettings();
+ return true;
+ }
+ }
+ return false;
+}
+
+QString CMakeCommandBuilder::defaultCommand()
+{
+ if (!m_defaultMake.isEmpty())
+ return m_defaultMake;
+
+ m_defaultMake = "cmake";
+ QString cmake = QStandardPaths::findExecutable(m_defaultMake);
+ if (!cmake.isEmpty())
+ m_defaultMake = cmake;
+
+ return m_defaultMake;
+}
+
+QStringList CMakeCommandBuilder::defaultArguments()
+{
+ if (!m_defaultArgs.isEmpty())
+ return m_defaultArgs;
+
+ // Build folder or "."
+ QString buildDir;
+ BuildConfiguration *buildConfig = buildStep()->buildConfiguration();
+ if (buildConfig)
+ buildDir = buildConfig->buildDirectory().toString();
+
+ if (buildDir.isEmpty())
+ buildDir = ".";
+
+ m_defaultArgs.append("--build");
+ m_defaultArgs.append(buildDir);
+ m_defaultArgs.append("--target");
+ m_defaultArgs.append("all");
+
+ return m_defaultArgs;
+}
+
+QString CMakeCommandBuilder::setMultiProcessArg(QString args)
+{
+ QRegExp regExp("\\s*\\-j\\s+\\d+");
+ args.remove(regExp);
+ args.append(" -- -j 200");
+
+ return args;
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/cmakecommandbuilder.h b/src/plugins/incredibuild/cmakecommandbuilder.h
new file mode 100644
index 00000000000..f8a1d8cb291
--- /dev/null
+++ b/src/plugins/incredibuild/cmakecommandbuilder.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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 <QCoreApplication>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class CMakeCommandBuilder : public CommandBuilder
+{
+ Q_DECLARE_TR_FUNCTIONS(CommandBuilder)
+public:
+ CMakeCommandBuilder(ProjectExplorer::BuildStep *buildStep) : CommandBuilder(buildStep) {}
+
+ bool canMigrate(ProjectExplorer::BuildStepList *buildStepList) override;
+
+ QString displayName() const override { return tr("CMake"); }
+ QString defaultCommand() override;
+ QStringList defaultArguments() override;
+ QString setMultiProcessArg(QString args) override;
+
+private:
+ QString m_defaultMake{};
+ QStringList m_defaultArgs{};
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
+
diff --git a/src/plugins/incredibuild/commandbuilder.cpp b/src/plugins/incredibuild/commandbuilder.cpp
new file mode 100644
index 00000000000..605d345a0e3
--- /dev/null
+++ b/src/plugins/incredibuild/commandbuilder.cpp
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "commandbuilder.h"
+
+namespace IncrediBuild {
+namespace Internal {
+
+namespace Constants {
+const QLatin1String CUSTOMCOMMANDBUILDER_COMMAND("IncrediBuild.BuildConsole.CustomCommandBuilder.Command");
+const QLatin1String CUSTOMCOMMANDBUILDER_ARGS("IncrediBuild.BuildConsole.CustomCommandBuilder.Arguments");
+const QLatin1String CUSTOMCOMMANDBUILDER_ARGSSET("IncrediBuild.BuildConsole.CustomCommandBuilder.ArgumentsSet");
+} // namespace Constants
+
+QString CommandBuilder::fullCommandFlag()
+{
+ QString argsLine;
+ for (const QString &a : arguments())
+ argsLine += "\"" + a + "\" ";
+
+ if (!keepJobNum())
+ argsLine = setMultiProcessArg(argsLine);
+
+ QString fullCommand("\"%0\" %1");
+ fullCommand = fullCommand.arg(command(), argsLine);
+
+ return fullCommand;
+}
+
+void CommandBuilder::reset()
+{
+ m_command.clear();
+ m_args.clear();
+ m_argsSet = false;
+}
+
+bool CommandBuilder::fromMap(const QVariantMap &map)
+{
+ m_command = map.value(Constants::CUSTOMCOMMANDBUILDER_COMMAND, QVariant(QString())).toString();
+ m_argsSet = map.value(Constants::CUSTOMCOMMANDBUILDER_ARGSSET, QVariant(false)).toBool();
+ if (m_argsSet)
+ arguments(map.value(Constants::CUSTOMCOMMANDBUILDER_ARGS, QVariant(QString())).toString());
+
+ // Not loading m_keepJobNum as it is managed by the build step.
+ return true;
+}
+
+void CommandBuilder::toMap(QVariantMap *map) const
+{
+ (*map)[Constants::CUSTOMCOMMANDBUILDER_COMMAND] = QVariant(m_command);
+ (*map)[Constants::CUSTOMCOMMANDBUILDER_ARGSSET] = QVariant(m_argsSet);
+ if (m_argsSet)
+ (*map)[Constants::CUSTOMCOMMANDBUILDER_ARGS] = QVariant(m_args);
+
+ // Not saving m_keepJobNum as it is managed by the build step.
+}
+
+// Split args to quoted or spaced parts
+void CommandBuilder::arguments(const QString &argsLine)
+{
+ QStringList args;
+ QString currArg;
+ bool inQuote = false;
+ bool inArg = false;
+ for (int i = 0; i < argsLine.length(); ++i) {
+ QChar c = argsLine[i];
+ if (c.isSpace()) {
+ if (!inArg) // Spaces between arguments
+ continue;
+
+ if (!inQuote) { // Arg termination
+ if (currArg.length() > 0) {
+ args.append(currArg);
+ currArg.clear();
+ }
+ inArg = false;
+ continue;
+ } else { // Space within argument
+ currArg += c;
+ continue;
+ }
+ }
+
+ inArg = true;
+ if (c == '"') {
+ if ((i < (argsLine.length() - 1))
+ && (argsLine[i + 1] == '"')) { // Convert '""' to double-quote within arg
+ currArg += '"';
+ ++i;
+ continue;
+ }
+
+ if (inQuote) { // Arg termination
+ if (currArg.length() > 0) {
+ args.append(currArg);
+ currArg.clear();
+ }
+ inArg = false;
+ inQuote = false;
+ continue;
+ }
+
+ // Arg start
+ inArg = true;
+ inQuote = true;
+ continue;
+ }
+
+ // Simple character
+ inArg = true;
+ currArg += c;
+ }
+
+ if (currArg.length() > 0)
+ args.append(currArg);
+
+ arguments(args);
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/commandbuilder.h b/src/plugins/incredibuild/commandbuilder.h
new file mode 100644
index 00000000000..b74cc17eaf6
--- /dev/null
+++ b/src/plugins/incredibuild/commandbuilder.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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 <projectexplorer/buildsteplist.h>
+
+#include <QObject>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class CommandBuilder
+{
+public:
+ CommandBuilder(ProjectExplorer::BuildStep *buildStep) : m_buildStep(buildStep) {}
+ virtual ~CommandBuilder() = default;
+
+ virtual bool canMigrate(ProjectExplorer::BuildStepList*) { return false; }
+
+ ProjectExplorer::BuildStep* buildStep() { return m_buildStep; }
+
+ virtual QString displayName() const { return QString("Custom Command"); }
+
+ virtual bool fromMap(const QVariantMap &map);
+ virtual void toMap(QVariantMap *map) const;
+
+ virtual QString defaultCommand() { return QString(); }
+ virtual QStringList defaultArguments() { return QStringList(); }
+ virtual QString setMultiProcessArg(QString args) { return args; }
+
+ void reset();
+
+ QString command() { return m_command.isEmpty() ? defaultCommand() : m_command; }
+ void command(const QString &command) { m_command = command; }
+
+ QStringList arguments() { return m_argsSet ? m_args : defaultArguments(); }
+ void arguments(const QStringList &arguments) { m_args = arguments; m_argsSet = !arguments.isEmpty(); }
+ void arguments(const QString &arguments);
+
+ bool keepJobNum() const { return m_keepJobNum; }
+ void keepJobNum(bool keepJobNum) { m_keepJobNum = keepJobNum; }
+
+ QString fullCommandFlag();
+
+private:
+ ProjectExplorer::BuildStep *m_buildStep{};
+ QString m_command{};
+ QStringList m_args{};
+ bool m_argsSet{false}; // Args may be overridden to empty
+ bool m_keepJobNum{false};
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolebuildstep.cpp b/src/plugins/incredibuild/ibconsolebuildstep.cpp
new file mode 100644
index 00000000000..90edb6bd56e
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolebuildstep.cpp
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "ibconsolebuildstep.h"
+
+#include "cmakecommandbuilder.h"
+#include "ibconsolestepconfigwidget.h"
+#include "incredibuildconstants.h"
+#include "incredibuildconstants.h"
+#include "makecommandbuilder.h"
+#include "ui_ibconsolebuildstep.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/gnumakeparser.h>
+#include <projectexplorer/kit.h>
+#include <projectexplorer/processparameters.h>
+#include <projectexplorer/target.h>
+#include <utils/environment.h>
+
+using namespace ProjectExplorer;
+
+namespace IncrediBuild {
+namespace Internal {
+
+namespace Constants {
+const QLatin1String IBCONSOLE_NICE("IncrediBuild.IBConsole.Nice");
+const QLatin1String IBCONSOLE_COMMANDBUILDER("IncrediBuild.IBConsole.CommandBuilder");
+const QLatin1String IBCONSOLE_KEEPJOBNUM("IncrediBuild.IBConsole.KeepJobNum");
+const QLatin1String IBCONSOLE_FORCEREMOTE("IncrediBuild.IBConsole.ForceRemote");
+const QLatin1String IBCONSOLE_ALTERNATE("IncrediBuild.IBConsole.Alternate");
+}
+
+IBConsoleBuildStep::IBConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList, Core::Id id)
+ : ProjectExplorer::AbstractProcessStep(buildStepList, id)
+ , m_earlierSteps(buildStepList)
+{
+ setDisplayName("IncrediBuild for Linux");
+ initCommandBuilders();
+}
+
+IBConsoleBuildStep::~IBConsoleBuildStep()
+{
+ for (CommandBuilder* p : m_commandBuildersList) {
+ delete p;
+ p = nullptr;
+ }
+}
+
+void IBConsoleBuildStep::tryToMigrate()
+{
+ // This is called when creating a fresh build step.
+ // Attempt to detect build system from pre-existing steps.
+ for (CommandBuilder* p : m_commandBuildersList) {
+ if (p->canMigrate(m_earlierSteps)) {
+ m_activeCommandBuilder = p;
+ break;
+ }
+ }
+}
+
+void IBConsoleBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
+{
+ formatter->addLineParser(new GnuMakeParser());
+ formatter->addLineParsers(target()->kit()->createOutputParsers());
+ formatter->addSearchDir(processParameters()->effectiveWorkingDirectory());
+ AbstractProcessStep::setupOutputFormatter(formatter);
+}
+
+bool IBConsoleBuildStep::fromMap(const QVariantMap &map)
+{
+ m_loadedFromMap = true;
+ m_nice = map.value(Constants::IBCONSOLE_NICE, QVariant(0)).toInt();
+ m_keepJobNum = map.value(Constants::IBCONSOLE_KEEPJOBNUM, QVariant(false)).toBool();
+ m_forceRemote = map.value(Constants::IBCONSOLE_FORCEREMOTE, QVariant(false)).toBool();
+ m_forceRemote = map.value(Constants::IBCONSOLE_ALTERNATE, QVariant(false)).toBool();
+
+ // Command builder. Default to the first in list, which should be the "Custom Command"
+ commandBuilder(map.value(Constants::IBCONSOLE_COMMANDBUILDER, QVariant(m_commandBuildersList.front()->displayName())).toString());
+ bool result = m_activeCommandBuilder->fromMap(map);
+
+ return result && AbstractProcessStep::fromMap(map);
+}
+
+QVariantMap IBConsoleBuildStep::toMap() const
+{
+ QVariantMap map = AbstractProcessStep::toMap();
+
+ map[IncrediBuild::Constants::INCREDIBUILD_BUILDSTEP_TYPE] = QVariant(IncrediBuild::Constants::IBCONSOLE_BUILDSTEP_ID);
+ map[Constants::IBCONSOLE_NICE] = QVariant(m_nice);
+ map[Constants::IBCONSOLE_KEEPJOBNUM] = QVariant(m_keepJobNum);
+ map[Constants::IBCONSOLE_ALTERNATE] = QVariant(m_forceRemote);
+ map[Constants::IBCONSOLE_FORCEREMOTE] = QVariant(m_forceRemote);
+ map[Constants::IBCONSOLE_COMMANDBUILDER] = QVariant(commandBuilder()->displayName());
+ m_activeCommandBuilder->toMap(&map);
+
+ return map;
+}
+
+bool IBConsoleBuildStep::init()
+{
+ QStringList args;
+
+ if (m_nice != 0)
+ args.append(QString("--nice %0 ").arg(m_nice));
+
+ if (m_alternate)
+ args.append("--alternate");
+
+ if (m_forceRemote)
+ args.append("--force-remote");
+
+ m_activeCommandBuilder->keepJobNum(m_keepJobNum);
+ args.append(m_activeCommandBuilder->fullCommandFlag());
+
+ Utils::CommandLine cmdLine("ib_console", args);
+ ProcessParameters *procParams = processParameters();
+ procParams->setCommandLine(cmdLine);
+ procParams->setEnvironment(Utils::Environment::systemEnvironment());
+
+ BuildConfiguration *buildConfig = buildConfiguration();
+ if (buildConfig) {
+ procParams->setWorkingDirectory(buildConfig->buildDirectory());
+ procParams->setEnvironment(buildConfig->environment());
+
+ Utils::MacroExpander *macroExpander = buildConfig->macroExpander();
+ if (macroExpander)
+ procParams->setMacroExpander(macroExpander);
+ }
+
+ return AbstractProcessStep::init();
+}
+
+BuildStepConfigWidget* IBConsoleBuildStep::createConfigWidget()
+{
+ return new IBConsoleStepConfigWidget(this);
+}
+
+void IBConsoleBuildStep::initCommandBuilders()
+{
+ if (m_commandBuildersList.empty()) {
+ m_commandBuildersList.push_back(new CommandBuilder(this)); // "Custom Command"- needs to be first in the list.
+ m_commandBuildersList.push_back(new MakeCommandBuilder(this));
+ m_commandBuildersList.push_back(new CMakeCommandBuilder(this));
+ }
+
+ // Default to "Custom Command".
+ if (!m_activeCommandBuilder)
+ m_activeCommandBuilder = m_commandBuildersList.front();
+}
+
+const QStringList& IBConsoleBuildStep::supportedCommandBuilders()
+{
+ static QStringList list;
+ if (list.empty()) {
+ initCommandBuilders();
+ for (CommandBuilder* p : m_commandBuildersList)
+ list.push_back(p->displayName());
+ }
+
+ return list;
+}
+
+void IBConsoleBuildStep::commandBuilder(const QString &commandBuilder)
+{
+ for (CommandBuilder* p : m_commandBuildersList) {
+ if (p->displayName().compare(commandBuilder) == 0) {
+ m_activeCommandBuilder = p;
+ break;
+ }
+ }
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolebuildstep.h b/src/plugins/incredibuild/ibconsolebuildstep.h
new file mode 100644
index 00000000000..0de10d61029
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolebuildstep.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** 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 IBConsoleBuildStep : public ProjectExplorer::AbstractProcessStep
+{
+ Q_OBJECT
+public:
+ explicit IBConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList, Core::Id id);
+ ~IBConsoleBuildStep() override;
+
+ bool init() override;
+
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
+
+ bool fromMap(const QVariantMap &map) override;
+ QVariantMap toMap() const override;
+
+ int nice() const { return m_nice; }
+ void nice(int nice) { m_nice = nice; }
+
+ bool keepJobNum() const { return m_keepJobNum; }
+ void keepJobNum(bool keepJobNum) { m_keepJobNum = keepJobNum; }
+
+ bool forceRemote() const { return m_forceRemote; }
+ void forceRemote(bool forceRemote) { m_forceRemote = forceRemote; }
+
+ bool alternate() const { return m_alternate; }
+ void alternate(bool alternate) { m_alternate = alternate; }
+
+ 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();
+
+ int m_nice{0};
+ bool m_keepJobNum{false};
+ bool m_forceRemote{false};
+ bool m_alternate{false};
+ ProjectExplorer::BuildStepList *m_earlierSteps{};
+ bool m_loadedFromMap{false};
+ CommandBuilder* m_activeCommandBuilder{};
+ QList<CommandBuilder*> m_commandBuildersList{};
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolebuildstep.ui b/src/plugins/incredibuild/ibconsolebuildstep.ui
new file mode 100644
index 00000000000..a80af67b1ba
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolebuildstep.ui
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>IncrediBuild::Internal::IBConsoleBuildStep</class>
+ <widget class="QWidget" name="IncrediBuild::Internal::IBConsoleBuildStep">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>355</width>
+ <height>273</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="6" column="0" colspan="2">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Enter the appropriate arguments to your build command</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QCheckBox" name="keepJobsNum">
+ <property name="toolTip">
+ <string>Setting this option to true, forces IncrediBuild to not override the -j command line switch. The default IncrediBuild behavior is to set a high value to the -j command line switch which controls the number of processes that the build tools executed by QT will execute in parallel (the default IncrediBuild behavior will set this value to 200).</string>
+ </property>
+ <property name="text">
+ <string>Keep Original Jobs Num</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target and configuration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="makeLabel">
+ <property name="text">
+ <string>Make command:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="13" column="1">
+ <widget class="QSpinBox" name="niceSpin">
+ <property name="minimum">
+ <number>-20</number>
+ </property>
+ <property name="maximum">
+ <number>19</number>
+ </property>
+ <property name="singleStep">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item row="14" column="0">
+ <widget class="QCheckBox" name="forceRemote">
+ <property name="toolTip">
+ <string extracomment="Force allow_remote tasks to remote helpers."/>
+ </property>
+ <property name="text">
+ <string>Force remote</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="makeArgumentsLineEdit"/>
+ </item>
+ <item row="10" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>IncrediBuild Distribution control</string>
+ </property>
+ </widget>
+ </item>
+ <item row="13" column="0">
+ <widget class="QLabel" name="maxCpuLabel">
+ <property name="toolTip">
+ <string>Specify nice value. Nice Value should be numeric and between -20 and 19</string>
+ </property>
+ <property name="text">
+ <string>Nice value:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="commandBuilder"/>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="makeArgumentsLabel">
+ <property name="text">
+ <string>Make arguments:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label">
+ <property name="toolTip">
+ <string>Select an helper to establish the build command.</string>
+ </property>
+ <property name="text">
+ <string>Command Helper:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="15" column="0">
+ <widget class="QCheckBox" name="alternate">
+ <property name="text">
+ <string>Alternate tasks preference</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="Utils::PathChooser" name="makePathChooser" native="true"/>
+ </item>
+ <item row="7" column="0" colspan="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Make sure the build command's multi-job parameter value is large enough (such as -J200 for the JOM or Make build tools).</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/incredibuild/ibconsolestepconfigwidget.cpp b/src/plugins/incredibuild/ibconsolestepconfigwidget.cpp
new file mode 100644
index 00000000000..5e67345e1db
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolestepconfigwidget.cpp
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "ibconsolestepconfigwidget.h"
+
+#include "ui_ibconsolebuildstep.h"
+
+#include <coreplugin/variablechooser.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+IBConsoleStepConfigWidget::IBConsoleStepConfigWidget(IBConsoleBuildStep *ibConsoleStep)
+ : ProjectExplorer::BuildStepConfigWidget(ibConsoleStep)
+ , m_buildStepUI(nullptr)
+ , m_buildStep(ibConsoleStep)
+{
+ // On first creation of the step, attempt to detect and migrate from preceding steps
+ if (!ibConsoleStep->loadedFromMap())
+ ibConsoleStep->tryToMigrate();
+
+ m_buildStepUI = new Ui_IBConsoleBuildStep();
+ m_buildStepUI->setupUi(this);
+ Core::VariableChooser::addSupportForChildWidgets(this, ibConsoleStep->macroExpander());
+
+ m_buildStepUI->commandBuilder->addItems(m_buildStep->supportedCommandBuilders());
+ m_buildStepUI->commandBuilder->setCurrentText(m_buildStep->commandBuilder()->displayName());
+ connect(m_buildStepUI->commandBuilder, &QComboBox::currentTextChanged, this, &IBConsoleStepConfigWidget::commandBuilderChanged);
+
+ QString command, defaultCommand;
+ defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
+ m_buildStepUI->makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
+ command = m_buildStep->commandBuilder()->command();
+ if (command != defaultCommand)
+ m_buildStepUI->makePathChooser->setPath(command);
+
+ m_buildStepUI->makePathChooser->setExpectedKind(Utils::PathChooser::Kind::ExistingCommand);
+ m_buildStepUI->makePathChooser->setBaseDirectory(Utils::FilePath::fromString(Utils::PathChooser::homePath()));
+ m_buildStepUI->makePathChooser->setHistoryCompleter(QLatin1String("IncrediBuild.IBConsole.MakeCommand.History"));
+ connect(m_buildStepUI->makePathChooser, &Utils::PathChooser::rawPathChanged, this, &IBConsoleStepConfigWidget::makePathEdited);
+
+ QString defaultArgs;
+ for (const QString &a : m_buildStep->commandBuilder()->defaultArguments())
+ defaultArgs += "\"" + a + "\" ";
+
+ QString args;
+ for (const QString &a : m_buildStep->commandBuilder()->arguments())
+ args += "\"" + a + "\" ";
+
+ m_buildStepUI->makeArgumentsLineEdit->setPlaceholderText(defaultArgs);
+ if (args != defaultArgs)
+ m_buildStepUI->makeArgumentsLineEdit->setText(args);
+ connect(m_buildStepUI->makeArgumentsLineEdit, &QLineEdit::textEdited, this, &IBConsoleStepConfigWidget::commandArgsChanged);
+
+ m_buildStepUI->niceSpin->setValue(m_buildStep->nice());
+ connect(m_buildStepUI->niceSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &IBConsoleStepConfigWidget::niceChanged);
+
+ m_buildStepUI->keepJobsNum->setChecked(m_buildStep->keepJobNum());
+ connect(m_buildStepUI->keepJobsNum, &QCheckBox::stateChanged, this, &IBConsoleStepConfigWidget::keepJobNumChanged);
+
+ m_buildStepUI->alternate->setChecked(m_buildStep->alternate());
+ connect(m_buildStepUI->alternate, &QCheckBox::stateChanged, this, &IBConsoleStepConfigWidget::alternateChanged);
+
+ m_buildStepUI->forceRemote->setChecked(m_buildStep->forceRemote());
+ connect(m_buildStepUI->forceRemote, &QCheckBox::stateChanged, this, &IBConsoleStepConfigWidget::forceRemoteChanged);
+}
+
+IBConsoleStepConfigWidget::~IBConsoleStepConfigWidget()
+{
+ delete m_buildStepUI;
+ m_buildStepUI = nullptr;
+}
+
+QString IBConsoleStepConfigWidget::displayName() const
+{
+ return tr("IncrediBuild for Linux");
+}
+
+QString IBConsoleStepConfigWidget::summaryText() const
+{
+ return "<b>" + displayName() + "</b>";
+}
+
+void IBConsoleStepConfigWidget::niceChanged(int)
+{
+ m_buildStep->nice(m_buildStepUI->niceSpin->value());
+}
+
+void IBConsoleStepConfigWidget::commandBuilderChanged(const QString&)
+{
+ m_buildStep->commandBuilder(m_buildStepUI->commandBuilder->currentText());
+
+ QString defaultArgs;
+ for (const QString &a : m_buildStep->commandBuilder()->defaultArguments())
+ defaultArgs += "\"" + a + "\" ";
+
+ QString args;
+ for (const QString &a : m_buildStep->commandBuilder()->arguments())
+ args += "\"" + a + "\" ";
+ if (args != defaultArgs)
+ m_buildStepUI->makeArgumentsLineEdit->setText(args);
+ else
+ m_buildStepUI->makeArgumentsLineEdit->setText("");
+
+ QString command, defaultCommand;
+ defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
+ m_buildStepUI->makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
+ command = m_buildStep->commandBuilder()->command();
+ if (command != defaultCommand)
+ m_buildStepUI->makePathChooser->setPath(command);
+ else
+ m_buildStepUI->makePathChooser->setPath("");
+}
+
+void IBConsoleStepConfigWidget::commandArgsChanged(const QString&)
+{
+ m_buildStep->commandBuilder()->arguments(m_buildStepUI->makeArgumentsLineEdit->text());
+}
+
+void IBConsoleStepConfigWidget::makePathEdited()
+{
+ m_buildStep->commandBuilder()->command(m_buildStepUI->makePathChooser->rawPath());
+}
+
+void IBConsoleStepConfigWidget::keepJobNumChanged()
+{
+ m_buildStep->keepJobNum(m_buildStepUI->keepJobsNum->checkState() == Qt::CheckState::Checked);
+}
+
+void IBConsoleStepConfigWidget::alternateChanged()
+{
+ m_buildStep->alternate(m_buildStepUI->alternate->checkState() == Qt::CheckState::Checked);
+}
+
+void IBConsoleStepConfigWidget::forceRemoteChanged()
+{
+ m_buildStep->forceRemote(m_buildStepUI->forceRemote->checkState() == Qt::CheckState::Checked);
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolestepconfigwidget.h b/src/plugins/incredibuild/ibconsolestepconfigwidget.h
new file mode 100644
index 00000000000..7682b875911
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolestepconfigwidget.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** 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 "ibconsolebuildstep.h"
+
+#include <projectexplorer/buildstep.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class Ui_IBConsoleBuildStep;
+
+class IBConsoleStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit IBConsoleStepConfigWidget(IBConsoleBuildStep *ibConsoleStep);
+ virtual ~IBConsoleStepConfigWidget();
+
+ QString displayName() const;
+ QString summaryText() const;
+
+private:
+ void niceChanged(int);
+ void keepJobNumChanged();
+ void forceRemoteChanged();
+ void alternateChanged();
+ void commandBuilderChanged(const QString&);
+ void commandArgsChanged(const QString&);
+ void makePathEdited();
+
+ Internal::Ui_IBConsoleBuildStep *m_buildStepUI;
+ IBConsoleBuildStep *m_buildStep;
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolestepfactory.cpp b/src/plugins/incredibuild/ibconsolestepfactory.cpp
new file mode 100644
index 00000000000..05c3664866a
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolestepfactory.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "ibconsolestepfactory.h"
+
+#include "ibconsolebuildstep.h"
+#include "incredibuildconstants.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/toolchainmanager.h>
+
+#include <QMessageBox>
+
+using namespace ProjectExplorer;
+
+namespace IncrediBuild {
+namespace Internal {
+
+IBConsoleStepFactory::IBConsoleStepFactory()
+{
+ registerStep<IBConsoleBuildStep>(Constants::IBCONSOLE_BUILDSTEP_ID);
+ setDisplayName(QObject::tr("IncrediBuild for Linux"));
+ setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
+ ProjectExplorer::Constants::BUILDSTEPS_CLEAN});
+}
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/ibconsolestepfactory.h b/src/plugins/incredibuild/ibconsolestepfactory.h
new file mode 100644
index 00000000000..171c2c4c2de
--- /dev/null
+++ b/src/plugins/incredibuild/ibconsolestepfactory.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** 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 <projectexplorer/abi.h>
+#include <projectexplorer/abstractprocessstep.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/target.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class IBConsoleStepFactory : public ProjectExplorer::BuildStepFactory
+{
+public:
+ IBConsoleStepFactory();
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/incredibuild.pro b/src/plugins/incredibuild/incredibuild.pro
new file mode 100644
index 00000000000..167da0bbb57
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuild.pro
@@ -0,0 +1,36 @@
+TARGET = IncrediBuild
+TEMPLATE = lib
+
+include(../../qtcreatorplugin.pri)
+
+DEFINES += INCREDIBUILD_LIBRARY
+
+# IncrediBuild files
+
+SOURCES += incredibuildplugin.cpp \
+ buildconsolebuildstep.cpp \
+ buildconsolestepfactory.cpp \
+ buildconsolestepconfigwidget.cpp \
+ commandbuilder.cpp \
+ makecommandbuilder.cpp \
+ cmakecommandbuilder.cpp \
+ ibconsolebuildstep.cpp \
+ ibconsolestepconfigwidget.cpp \
+ ibconsolestepfactory.cpp
+
+HEADERS += incredibuildplugin.h \
+ buildconsolestepconfigwidget.h \
+ buildconsolestepfactory.h \
+ cmakecommandbuilder.h \
+ commandbuilder.h \
+ ibconsolestepconfigwidget.h \
+ incredibuild_global.h \
+ incredibuildconstants.h \
+ buildconsolebuildstep.h \
+ makecommandbuilder.h \
+ ibconsolebuildstep.h \
+ ibconsolestepfactory.h
+
+FORMS += \
+ buildconsolebuildstep.ui \
+ ibconsolebuildstep.ui
diff --git a/src/plugins/incredibuild/incredibuild.qbs b/src/plugins/incredibuild/incredibuild.qbs
new file mode 100644
index 00000000000..5015fbe3932
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuild.qbs
@@ -0,0 +1,37 @@
+import qbs 1.0
+
+QtcPlugin {
+ name: "IncrediBuild"
+
+ Depends { name: "Qt"; submodules: ["widgets", "network"] }
+
+ Depends { name: "Core" }
+ Depends { name: "ProjectExplorer" }
+
+ files: [
+ "buildconsolebuildstep.cpp",
+ "buildconsolebuildstep.h",
+ "buildconsolebuildstep.ui",
+ "buildconsolestepconfigwidget.cpp",
+ "buildconsolestepconfigwidget.h",
+ "buildconsolestepfactory.cpp",
+ "buildconsolestepfactory.h",
+ "cmakecommandbuilder.cpp",
+ "cmakecommandbuilder.h",
+ "commandbuilder.cpp",
+ "commandbuilder.h",
+ "ibconsolebuildstep.cpp",
+ "ibconsolebuildstep.h",
+ "ibconsolebuildstep.ui",
+ "ibconsolestepconfigwidget.cpp",
+ "ibconsolestepconfigwidget.h",
+ "ibconsolestepfactory.cpp",
+ "ibconsolestepfactory.h",
+ "incredibuild_global.h",
+ "incredibuildconstants.h",
+ "incredibuildplugin.cpp",
+ "incredibuildplugin.h",
+ "makecommandbuilder.cpp",
+ "makecommandbuilder.h",
+ ]
+}
diff --git a/src/plugins/incredibuild/incredibuild_dependencies.pri b/src/plugins/incredibuild/incredibuild_dependencies.pri
new file mode 100644
index 00000000000..14013348fd1
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuild_dependencies.pri
@@ -0,0 +1,10 @@
+QTC_PLUGIN_NAME = IncrediBuild
+QTC_LIB_DEPENDS += \
+
+QTC_PLUGIN_DEPENDS += \
+ coreplugin \
+ projectexplorer
+
+QTC_PLUGIN_RECOMMENDS += \
+ qmakeprojectmanager \
+ cmakeprojectmanager
diff --git a/src/plugins/incredibuild/incredibuild_global.h b/src/plugins/incredibuild/incredibuild_global.h
new file mode 100644
index 00000000000..06e4483df3f
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuild_global.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** 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 <QtGlobal>
+
+#if defined(INCREDIBUILD_LIBRARY)
+# define INCREDIBUILDSHARED_EXPORT Q_DECL_EXPORT
+#else
+# define INCREDIBUILDSHARED_EXPORT Q_DECL_IMPORT
+#endif
diff --git a/src/plugins/incredibuild/incredibuildconstants.h b/src/plugins/incredibuild/incredibuildconstants.h
new file mode 100644
index 00000000000..4dbf253a3f0
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuildconstants.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** 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
+
+namespace IncrediBuild {
+namespace Constants {
+
+const char INCREDIBUILD_BUILDSTEP_TYPE[] = "IncrediBuild.BuildStep.Type";
+
+const char BUILDCONSOLE_BUILDSTEP_ID[] = "IncrediBuild.BuildStep.BuildConsole";
+const char IBCONSOLE_BUILDSTEP_ID[] = "IncrediBuild.BuildStep.IB_Console";
+
+} // namespace Constants
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/incredibuildplugin.cpp b/src/plugins/incredibuild/incredibuildplugin.cpp
new file mode 100644
index 00000000000..8a0740bbb7f
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuildplugin.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "incredibuildplugin.h"
+
+#include "incredibuildconstants.h"
+
+namespace IncrediBuild {
+namespace Internal {
+
+IncrediBuildPlugin::~IncrediBuildPlugin()
+{
+ // Unregister objects from the plugin manager's object pool
+ // Delete members
+ delete m_iBConsoleStepFactory;
+ delete m_buildConsoleStepFactory;
+}
+
+bool IncrediBuildPlugin::initialize(const QStringList &arguments, QString *errorString)
+{
+ // Register objects in the plugin manager's object pool
+ // Load settings
+ // Add actions to menus
+ // Connect to other plugins' signals
+ // In the initialize function, a plugin can be sure that the plugins it
+ // depends on have initialized their members.
+
+ Q_UNUSED(arguments)
+ Q_UNUSED(errorString)
+
+ m_buildConsoleStepFactory = new BuildConsoleStepFactory();
+ m_iBConsoleStepFactory = new IBConsoleStepFactory();
+
+ return true;
+}
+
+void IncrediBuildPlugin::extensionsInitialized()
+{
+ // Retrieve objects from the plugin manager's object pool
+ // In the extensionsInitialized function, a plugin can be sure that all
+ // plugins that depend on it are completely initialized.
+}
+
+ExtensionSystem::IPlugin::ShutdownFlag IncrediBuildPlugin::aboutToShutdown()
+{
+ // Save settings
+ // Disconnect from signals that are not needed during shutdown
+ // Hide UI (if you add UI that is not in the main window directly)
+ return SynchronousShutdown;
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/incredibuildplugin.h b/src/plugins/incredibuild/incredibuildplugin.h
new file mode 100644
index 00000000000..5298a10bcdf
--- /dev/null
+++ b/src/plugins/incredibuild/incredibuildplugin.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** 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 "incredibuild_global.h"
+#include "buildconsolestepfactory.h"
+#include "ibconsolestepfactory.h"
+
+#include <extensionsystem/iplugin.h>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class IncrediBuildPlugin : public ExtensionSystem::IPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "IncrediBuild.json")
+
+public:
+ IncrediBuildPlugin() {}
+ ~IncrediBuildPlugin();
+
+ bool initialize(const QStringList &arguments, QString *errorString);
+ void extensionsInitialized();
+ ShutdownFlag aboutToShutdown();
+
+private:
+ BuildConsoleStepFactory *m_buildConsoleStepFactory{};
+ IBConsoleStepFactory *m_iBConsoleStepFactory{};
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/makecommandbuilder.cpp b/src/plugins/incredibuild/makecommandbuilder.cpp
new file mode 100644
index 00000000000..4dff702c551
--- /dev/null
+++ b/src/plugins/incredibuild/makecommandbuilder.cpp
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#include "makecommandbuilder.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/project.h>
+
+#include <QDebug>
+#include <QFileInfo>
+#include <QRegExp>
+
+using namespace ProjectExplorer;
+
+namespace IncrediBuild {
+namespace Internal {
+
+bool MakeCommandBuilder::canMigrate(BuildStepList *buildStepList)
+{
+ // "Make"
+ QString makeClassName("QmakeProjectManager::QmakeMakeStep");
+ for (int i = buildStepList->count() - 1; i >= 0; --i) {
+ QString className = QString::fromUtf8(buildStepList->at(i)->metaObject()->className());
+ if (className.compare(makeClassName) == 0) {
+ buildStepList->at(i)->setEnabled(false);
+ buildStepList->at(i)->projectConfiguration()->project()->saveSettings();
+ return true;
+ }
+ }
+ return false;
+}
+
+QString MakeCommandBuilder::defaultCommand()
+{
+ if (!m_defaultMake.isEmpty())
+ return m_defaultMake;
+
+ BuildConfiguration *buildConfig = buildStep()->buildConfiguration();
+ if (buildConfig) {
+ Target *target = buildStep()->target();
+ if (target) {
+ ToolChain *toolChain = ToolChainKitAspect::toolChain(target->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
+ if (toolChain)
+ m_defaultMake = toolChain->makeCommand(buildConfig->environment()).toString();
+ }
+ }
+
+ return m_defaultMake;
+}
+
+
+QString MakeCommandBuilder::setMultiProcessArg(QString args)
+{
+ QString cmd = command();
+ QFileInfo fileInfo(cmd);
+
+ // jom -j 200
+ if (fileInfo.baseName().compare("jom", Qt::CaseSensitivity::CaseInsensitive) == 0) {
+ QRegExp regExp("\\s*\\-j\\s+\\d+");
+ args.remove(regExp);
+ args.append(" -j 200");
+ }
+ // make -j200
+ else if ((fileInfo.baseName().compare("make", Qt::CaseSensitivity::CaseInsensitive) == 0) || (fileInfo.baseName().compare("gmake", Qt::CaseSensitivity::CaseInsensitive) == 0)) {
+ QRegExp regExp("\\s*\\-j\\d+");
+ args.remove(regExp);
+ args.append(" -j200");
+ }
+
+ return args;
+}
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/incredibuild/makecommandbuilder.h b/src/plugins/incredibuild/makecommandbuilder.h
new file mode 100644
index 00000000000..7a72a9987c4
--- /dev/null
+++ b/src/plugins/incredibuild/makecommandbuilder.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** 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 <QCoreApplication>
+
+namespace IncrediBuild {
+namespace Internal {
+
+class MakeCommandBuilder : public CommandBuilder
+{
+ Q_DECLARE_TR_FUNCTIONS(MakeCommandBuilder)
+public:
+ MakeCommandBuilder(ProjectExplorer::BuildStep *buildStep) : CommandBuilder(buildStep) {}
+
+ bool canMigrate(ProjectExplorer::BuildStepList *buildStepList) override;
+ QString displayName() const override { return tr("Make"); }
+ QString defaultCommand() override;
+ QString setMultiProcessArg(QString args) override;
+
+private:
+ QString m_defaultMake{};
+};
+
+} // namespace Internal
+} // namespace IncrediBuild
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index a9da5bf019d..12d87206ab3 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -65,7 +65,8 @@ SUBDIRS = \
studiowelcome \
webassembly \
mcusupport \
- marketplace
+ marketplace \
+ incredibuild
qtHaveModule(serialport) {
SUBDIRS += serialterminal
diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs
index abae37febf4..5ef58f33ebf 100644
--- a/src/plugins/plugins.qbs
+++ b/src/plugins/plugins.qbs
@@ -44,6 +44,7 @@ Project {
"helloworld/helloworld.qbs",
"help/help.qbs",
"imageviewer/imageviewer.qbs",
+ "incredibuild/incredibuild.qbs",
"ios/ios.qbs",
"languageclient/languageclient.qbs",
"macros/macros.qbs",