forked from qt-creator/qt-creator
IncrediBuild: Rework BuildConsoleBuildStep
Change-Id: I7ab8bc18c229e1d748dbbc494b2ba254085c0e0e Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -4,11 +4,6 @@ add_qtc_plugin(IncrediBuild
|
||||
SOURCES
|
||||
buildconsolebuildstep.cpp
|
||||
buildconsolebuildstep.h
|
||||
buildconsolebuildstep.ui
|
||||
buildconsolestepconfigwidget.cpp
|
||||
buildconsolestepconfigwidget.h
|
||||
buildconsolestepfactory.cpp
|
||||
buildconsolestepfactory.h
|
||||
cmakecommandbuilder.cpp
|
||||
cmakecommandbuilder.h
|
||||
commandbuilder.cpp
|
||||
|
@@ -25,24 +25,36 @@
|
||||
|
||||
#include "buildconsolebuildstep.h"
|
||||
|
||||
#include "buildconsolestepconfigwidget.h"
|
||||
#include "cmakecommandbuilder.h"
|
||||
#include "incredibuildconstants.h"
|
||||
#include "makecommandbuilder.h"
|
||||
#include "ui_buildconsolebuildstep.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace IncrediBuild {
|
||||
namespace Internal {
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Constants {
|
||||
const QLatin1String BUILDCONSOLE_AVOIDLOCAL("IncrediBuild.BuildConsole.AvoidLocal");
|
||||
const QLatin1String BUILDCONSOLE_PROFILEXML("IncrediBuild.BuildConsole.ProfileXml");
|
||||
@@ -66,33 +78,409 @@ const QLatin1String BUILDCONSOLE_KEEPJOBNUM("IncrediBuild.BuildConsole.KeepJobNu
|
||||
const QLatin1String BUILDCONSOLE_COMMANDBUILDER("IncrediBuild.BuildConsole.CommandBuilder");
|
||||
}
|
||||
|
||||
BuildConsoleBuildStep::BuildConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList,
|
||||
Utils::Id id)
|
||||
: ProjectExplorer::AbstractProcessStep(buildStepList, id)
|
||||
, m_earlierSteps(buildStepList)
|
||||
class BuildConsoleBuildStep : public AbstractProcessStep
|
||||
{
|
||||
setDisplayName("IncrediBuild for Windows");
|
||||
initCommandBuilders();
|
||||
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::BuildConsoleBuildStep)
|
||||
|
||||
public:
|
||||
BuildConsoleBuildStep(BuildStepList *buildStepList, Id id);
|
||||
|
||||
bool init() final;
|
||||
|
||||
BuildStepConfigWidget *createConfigWidget() final;
|
||||
|
||||
bool fromMap(const QVariantMap &map) final;
|
||||
QVariantMap toMap() const final;
|
||||
|
||||
const QStringList &supportedWindowsVersions() const;
|
||||
const QStringList &supportedCommandBuilders();
|
||||
|
||||
CommandBuilder *commandBuilder() const { return m_activeCommandBuilder; }
|
||||
void commandBuilder(const QString &commandBuilder);
|
||||
|
||||
void tryToMigrate();
|
||||
|
||||
void setupOutputFormatter(OutputFormatter *formatter) final;
|
||||
|
||||
QString normalizeWinVerArgument(QString winVer);
|
||||
|
||||
bool m_loadedFromMap{false};
|
||||
|
||||
BaseBoolAspect *m_avoidLocal{nullptr};
|
||||
BaseStringAspect *m_profileXml{nullptr};
|
||||
BaseIntegerAspect *m_maxCpu{nullptr};
|
||||
BaseSelectionAspect *m_maxWinVer{nullptr};
|
||||
BaseSelectionAspect *m_minWinVer{nullptr};
|
||||
BaseStringAspect *m_title{nullptr};
|
||||
BaseStringAspect *m_monFile{nullptr};
|
||||
BaseBoolAspect *m_suppressStdOut{nullptr};
|
||||
BaseStringAspect *m_logFile{nullptr};
|
||||
BaseBoolAspect *m_showCmd{nullptr};
|
||||
BaseBoolAspect *m_showAgents{nullptr};
|
||||
BaseBoolAspect *m_showTime{nullptr};
|
||||
BaseBoolAspect *m_hideHeader{nullptr};
|
||||
BaseSelectionAspect *m_logLevel{nullptr};
|
||||
BaseStringAspect *m_setEnv{nullptr};
|
||||
BaseBoolAspect *m_stopOnError{nullptr};
|
||||
BaseStringAspect *m_additionalArguments{nullptr};
|
||||
BaseBoolAspect *m_openMonitor{nullptr};
|
||||
BaseBoolAspect *m_keepJobNum{nullptr};
|
||||
|
||||
CommandBuilder m_customCommandBuilder{this};
|
||||
MakeCommandBuilder m_makeCommandBuilder{this};
|
||||
CMakeCommandBuilder m_cmakeCommandBuilder{this};
|
||||
|
||||
CommandBuilder *m_commandBuilders[3] {
|
||||
&m_customCommandBuilder,
|
||||
&m_makeCommandBuilder,
|
||||
&m_cmakeCommandBuilder
|
||||
};
|
||||
|
||||
CommandBuilder *m_activeCommandBuilder{m_commandBuilders[0]};
|
||||
};
|
||||
|
||||
|
||||
class BuildConsoleStepConfigWidget : public BuildStepConfigWidget
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::BuildConsoleBuildStep)
|
||||
|
||||
public:
|
||||
explicit BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep);
|
||||
|
||||
private:
|
||||
void commandBuilderChanged();
|
||||
void commandArgsChanged();
|
||||
void makePathEdited();
|
||||
|
||||
BuildConsoleBuildStep *m_buildStep;
|
||||
|
||||
QLineEdit *makeArgumentsLineEdit;
|
||||
QComboBox *commandBuilder;
|
||||
PathChooser *makePathChooser;
|
||||
};
|
||||
|
||||
// BuildConsoleStepConfigWidget
|
||||
|
||||
BuildConsoleStepConfigWidget::BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep)
|
||||
: BuildStepConfigWidget(buildConsoleStep)
|
||||
, m_buildStep(buildConsoleStep)
|
||||
{
|
||||
setDisplayName(tr("IncrediBuild for Windows"));
|
||||
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
font.setWeight(75);
|
||||
|
||||
auto sectionTarget = new QLabel(tr("Target and configuration"), this);
|
||||
sectionTarget->setFont(font);
|
||||
|
||||
auto sectionMisc = new QLabel(tr("Miscellaneous"), this);
|
||||
sectionMisc->setFont(font);
|
||||
|
||||
auto sectionDistribution = new QLabel(tr("IncrediBuild Distribution control"), this);
|
||||
sectionDistribution->setFont(font);
|
||||
|
||||
auto sectionLogging = new QLabel(tr("Output and Logging"), this);
|
||||
sectionLogging->setFont(font);
|
||||
|
||||
commandBuilder = new QComboBox(this);
|
||||
|
||||
const auto emphasize = [](const QString &msg) { return QString("<i>" + msg); };
|
||||
auto infoLabel1 = new QLabel(emphasize(tr("Enter the appropriate arguments to your build "
|
||||
"command.")), this);
|
||||
auto infoLabel2 = new QLabel(emphasize(tr("Make sure the build command's "
|
||||
"multi-job parameter value is large enough (such as "
|
||||
"-j200 for the JOM or Make build tools)")), this);
|
||||
|
||||
auto label = new QLabel(tr("Command Helper:"), this);
|
||||
label->setToolTip(tr("Select an helper to establish the build command."));
|
||||
|
||||
commandBuilder->addItems(m_buildStep->supportedCommandBuilders());
|
||||
commandBuilder->setCurrentText(m_buildStep->commandBuilder()->displayName());
|
||||
connect(commandBuilder, &QComboBox::currentTextChanged, this, &BuildConsoleStepConfigWidget::commandBuilderChanged);
|
||||
|
||||
makePathChooser = new PathChooser;
|
||||
makeArgumentsLineEdit = new QLineEdit(this);
|
||||
const QString defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
|
||||
makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
|
||||
const QString command = m_buildStep->commandBuilder()->command();
|
||||
if (command != defaultCommand)
|
||||
makePathChooser->setPath(command);
|
||||
|
||||
makePathChooser->setExpectedKind(PathChooser::Kind::ExistingCommand);
|
||||
makePathChooser->setBaseDirectory(FilePath::fromString(PathChooser::homePath()));
|
||||
makePathChooser->setHistoryCompleter("IncrediBuild.BuildConsole.MakeCommand.History");
|
||||
connect(makePathChooser, &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 + "\" ";
|
||||
|
||||
makeArgumentsLineEdit->setPlaceholderText(defaultArgs);
|
||||
if (args != defaultArgs)
|
||||
makeArgumentsLineEdit->setText(args);
|
||||
|
||||
connect(makeArgumentsLineEdit, &QLineEdit::textEdited, this, &BuildConsoleStepConfigWidget::commandArgsChanged);
|
||||
|
||||
LayoutBuilder builder(this);
|
||||
builder.addRow(sectionTarget);
|
||||
builder.startNewRow().addItems(label, commandBuilder);
|
||||
builder.startNewRow().addItems(tr("Make command:"), makePathChooser);
|
||||
builder.startNewRow().addItems(tr("Make arguments:"), makeArgumentsLineEdit);
|
||||
builder.addRow(infoLabel1);
|
||||
builder.addRow(infoLabel2);
|
||||
builder.addRow(buildConsoleStep->m_keepJobNum);
|
||||
|
||||
builder.addRow(sectionDistribution);
|
||||
builder.addRow(buildConsoleStep->m_profileXml);
|
||||
builder.addRow(buildConsoleStep->m_avoidLocal);
|
||||
builder.addRow(buildConsoleStep->m_maxCpu);
|
||||
builder.addRow(buildConsoleStep->m_maxWinVer);
|
||||
builder.addRow(buildConsoleStep->m_minWinVer);
|
||||
|
||||
builder.addRow(sectionLogging);
|
||||
builder.addRow(buildConsoleStep->m_title);
|
||||
builder.addRow(buildConsoleStep->m_monFile);
|
||||
builder.addRow(buildConsoleStep->m_suppressStdOut);
|
||||
builder.addRow(buildConsoleStep->m_logFile);
|
||||
builder.addRow(buildConsoleStep->m_showCmd);
|
||||
builder.addRow(buildConsoleStep->m_showAgents);
|
||||
builder.addRow(buildConsoleStep->m_showTime);
|
||||
builder.addRow(buildConsoleStep->m_hideHeader);
|
||||
builder.addRow(buildConsoleStep->m_logLevel);
|
||||
|
||||
builder.addRow(sectionMisc);
|
||||
builder.addRow(buildConsoleStep->m_setEnv);
|
||||
builder.addRow(buildConsoleStep->m_stopOnError);
|
||||
builder.addRow(buildConsoleStep->m_additionalArguments);
|
||||
builder.addRow(buildConsoleStep->m_openMonitor);
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(this, buildConsoleStep->macroExpander());
|
||||
}
|
||||
|
||||
BuildConsoleBuildStep::~BuildConsoleBuildStep()
|
||||
void BuildConsoleStepConfigWidget::commandBuilderChanged()
|
||||
{
|
||||
qDeleteAll(m_commandBuildersList);
|
||||
m_buildStep->commandBuilder(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)
|
||||
makeArgumentsLineEdit->clear();
|
||||
makeArgumentsLineEdit->setText(args);
|
||||
|
||||
const QString defaultCommand = m_buildStep->commandBuilder()->defaultCommand();
|
||||
makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
|
||||
QString command = m_buildStep->commandBuilder()->command();
|
||||
if (command == defaultCommand)
|
||||
command.clear();
|
||||
makePathChooser->setPath(command);
|
||||
}
|
||||
|
||||
void BuildConsoleStepConfigWidget::commandArgsChanged()
|
||||
{
|
||||
m_buildStep->commandBuilder()->arguments(makeArgumentsLineEdit->text());
|
||||
}
|
||||
|
||||
void BuildConsoleStepConfigWidget::makePathEdited()
|
||||
{
|
||||
m_buildStep->commandBuilder()->command(makePathChooser->rawPath());
|
||||
}
|
||||
|
||||
// BuildConsoleBuilStep
|
||||
|
||||
BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id)
|
||||
: AbstractProcessStep(buildStepList, id)
|
||||
{
|
||||
setDisplayName("IncrediBuild for Windows");
|
||||
|
||||
m_maxCpu = addAspect<BaseIntegerAspect>();
|
||||
m_maxCpu->setSettingsKey(Constants::BUILDCONSOLE_MAXCPU);
|
||||
m_maxCpu->setToolTip(tr("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."));
|
||||
m_maxCpu->setLabel(tr("Maximum CPUs to utilize in the build:"));
|
||||
m_maxCpu->setRange(0, 65536);
|
||||
|
||||
m_avoidLocal = addAspect<BaseBoolAspect>();
|
||||
m_avoidLocal->setSettingsKey(Constants::BUILDCONSOLE_AVOIDLOCAL);
|
||||
m_avoidLocal->setLabel(tr("Avoid Local:"), BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_avoidLocal->setToolTip(tr("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."));
|
||||
|
||||
m_profileXml = addAspect<BaseStringAspect>();
|
||||
m_profileXml->setSettingsKey(Constants::BUILDCONSOLE_PROFILEXML);
|
||||
m_profileXml->setLabelText(tr("Profile.xml:"));
|
||||
m_profileXml->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
|
||||
m_profileXml->setExpectedKind(PathChooser::Kind::File);
|
||||
m_profileXml->setBaseFileName(FilePath::fromString(PathChooser::homePath()));
|
||||
m_profileXml->setHistoryCompleter("IncrediBuild.BuildConsole.ProfileXml.History");
|
||||
m_profileXml->setToolTip(tr("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 \"InExtraLabel 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."));
|
||||
|
||||
m_maxWinVer = addAspect<BaseSelectionAspect>();
|
||||
m_maxWinVer->setSettingsKey(Constants::BUILDCONSOLE_MAXWINVER);
|
||||
m_maxWinVer->setDisplayName(tr("Newest allowed helper machine OS:"));
|
||||
m_maxWinVer->setDisplayStyle(BaseSelectionAspect::DisplayStyle::ComboBox);
|
||||
m_maxWinVer->setToolTip(tr("Specifies the newest operating system installed on a helper "
|
||||
"machine to be allowed to participate as helper in the build."));
|
||||
for (const QString &version : supportedWindowsVersions())
|
||||
m_maxWinVer->addOption(version);
|
||||
|
||||
m_minWinVer = addAspect<BaseSelectionAspect>();
|
||||
m_minWinVer->setSettingsKey(Constants::BUILDCONSOLE_MINWINVER);
|
||||
m_minWinVer->setDisplayName(tr("Oldest allowed helper machine OS:"));
|
||||
m_minWinVer->setDisplayStyle(BaseSelectionAspect::DisplayStyle::ComboBox);
|
||||
m_minWinVer->setToolTip(tr("Specifies the oldest operating system installed on a helper "
|
||||
"machine to be allowed to participate as helper in the build."));
|
||||
for (const QString &version : supportedWindowsVersions())
|
||||
m_minWinVer->addOption(version);
|
||||
|
||||
m_title = addAspect<BaseStringAspect>();
|
||||
m_title->setSettingsKey(Constants::BUILDCONSOLE_TITLE);
|
||||
m_title->setLabelText(tr("Build Title:"));
|
||||
m_title->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
||||
m_title->setToolTip(tr("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."));
|
||||
|
||||
m_monFile = addAspect<BaseStringAspect>();
|
||||
m_monFile->setSettingsKey(Constants::BUILDCONSOLE_MONFILE);
|
||||
m_monFile->setLabelText(tr("Save IncrediBuild monitor file:"));
|
||||
m_monFile->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
|
||||
m_monFile->setExpectedKind(PathChooser::Kind::Any);
|
||||
m_monFile->setBaseFileName(FilePath::fromString(PathChooser::homePath()));
|
||||
m_monFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History"));
|
||||
m_monFile->setToolTip(tr("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"));
|
||||
|
||||
m_suppressStdOut = addAspect<BaseBoolAspect>();
|
||||
m_suppressStdOut->setSettingsKey(Constants::BUILDCONSOLE_SUPPRESSSTDOUT);
|
||||
m_suppressStdOut->setLabel(tr("Suppress STDOUT:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_suppressStdOut->setToolTip(tr("Does not write anything to the standard output."));
|
||||
|
||||
m_logFile = addAspect<BaseStringAspect>();
|
||||
m_logFile->setSettingsKey(Constants::BUILDCONSOLE_LOGFILE);
|
||||
m_logFile->setLabelText(tr("Output Log file:"));
|
||||
m_logFile->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
|
||||
m_logFile->setExpectedKind(PathChooser::Kind::SaveFile);
|
||||
m_logFile->setBaseFileName(FilePath::fromString(PathChooser::homePath()));
|
||||
m_logFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History"));
|
||||
m_logFile->setToolTip(tr("Writes build output to a file."));
|
||||
|
||||
m_showCmd = addAspect<BaseBoolAspect>();
|
||||
m_showCmd->setSettingsKey(Constants::BUILDCONSOLE_SHOWCMD);
|
||||
m_showCmd->setLabel(tr("Show Commands in output:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_showCmd->setToolTip(tr("Shows, for each file built, the command-line used by IncrediBuild "
|
||||
"to build the file."));
|
||||
|
||||
m_showAgents = addAspect<BaseBoolAspect>();
|
||||
m_showAgents->setSettingsKey(Constants::BUILDCONSOLE_SHOWAGENTS);
|
||||
m_showAgents->setLabel(tr("Show Agents in output:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_showAgents->setToolTip(tr("Shows the Agent used to build each file."));
|
||||
|
||||
m_showTime = addAspect<BaseBoolAspect>();
|
||||
m_showTime->setSettingsKey(Constants::BUILDCONSOLE_SHOWTIME);
|
||||
m_showTime->setLabel(tr("Show Time in output:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_showTime->setToolTip(tr("Shows the Start and Finish time for each file built."));
|
||||
|
||||
m_hideHeader = addAspect<BaseBoolAspect>();
|
||||
m_hideHeader->setSettingsKey(Constants::BUILDCONSOLE_HIDEHEADER);
|
||||
m_hideHeader->setLabel(tr("Hide IncrediBuild Header in output:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_hideHeader->setToolTip(tr("Suppresses the \"IncrediBuild\" header in the build output"));
|
||||
|
||||
m_logLevel = addAspect<BaseSelectionAspect>();
|
||||
m_logLevel->setSettingsKey(Constants::BUILDCONSOLE_LOGLEVEL);
|
||||
m_logLevel->setDisplayName(tr("Internal IncrediBuild logging level:"));
|
||||
m_logLevel->setDisplayStyle(BaseSelectionAspect::DisplayStyle::ComboBox);
|
||||
m_logLevel->addOption(QString());
|
||||
m_logLevel->addOption("Minimal");
|
||||
m_logLevel->addOption("Extended");
|
||||
m_logLevel->addOption("Detailed");
|
||||
m_logLevel->setToolTip(tr("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"));
|
||||
|
||||
m_setEnv = addAspect<BaseStringAspect>();
|
||||
m_setEnv->setSettingsKey(Constants::BUILDCONSOLE_SETENV);
|
||||
m_setEnv->setLabelText(tr("Set an Environment Variable:"));
|
||||
m_setEnv->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
||||
m_setEnv->setToolTip(tr("Sets or overrides environment variables for the context of the build."));
|
||||
|
||||
m_stopOnError = addAspect<BaseBoolAspect>();
|
||||
m_stopOnError->setSettingsKey(Constants::BUILDCONSOLE_STOPONERROR);
|
||||
m_stopOnError->setLabel(tr("Stop On Errors:"), BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_stopOnError->setToolTip(tr("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"));
|
||||
|
||||
m_additionalArguments = addAspect<BaseStringAspect>();
|
||||
m_additionalArguments->setSettingsKey(Constants::BUILDCONSOLE_ADDITIONALARGUMENTS);
|
||||
m_additionalArguments->setLabelText(tr("Additional Arguments:"));
|
||||
m_additionalArguments->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
||||
m_additionalArguments->setToolTip(tr("Add additional buildconsole arguments manually. "
|
||||
"The value of this field will be concatenated to the "
|
||||
"final buildconsole command line"));
|
||||
|
||||
|
||||
m_openMonitor = addAspect<BaseBoolAspect>();
|
||||
m_openMonitor->setSettingsKey(Constants::BUILDCONSOLE_OPENMONITOR);
|
||||
m_openMonitor->setLabel(tr("Open Monitor:"), BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_openMonitor->setToolTip(tr("Opens an IncrediBuild Build Monitor that graphically displays "
|
||||
"the build progress once the build starts."));
|
||||
|
||||
m_keepJobNum = addAspect<BaseBoolAspect>();
|
||||
m_keepJobNum->setSettingsKey(Constants::BUILDCONSOLE_KEEPJOBNUM);
|
||||
m_keepJobNum->setLabel(tr("Keep Original Jobs Num:"),
|
||||
BaseBoolAspect::LabelPlacement::InExtraLabel);
|
||||
m_keepJobNum->setToolTip(tr("Setting this option to true, forces IncrediBuild to not override "
|
||||
"the -j command line switch. </p>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 Creator will execute in parallel (the default "
|
||||
"IncrediBuild behavior will set this value to 200)"));
|
||||
}
|
||||
|
||||
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)) {
|
||||
for (CommandBuilder *p : m_commandBuilders) {
|
||||
if (p->canMigrate(stepList())) {
|
||||
m_activeCommandBuilder = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BuildConsoleBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
|
||||
void BuildConsoleBuildStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
formatter->addLineParser(new GnuMakeParser());
|
||||
formatter->addLineParsers(target()->kit()->createOutputParsers());
|
||||
@@ -103,29 +491,10 @@ void BuildConsoleBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatt
|
||||
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()))
|
||||
QVariant(m_commandBuilders[0]->displayName()))
|
||||
.toString());
|
||||
bool result = m_activeCommandBuilder->fromMap(map);
|
||||
|
||||
@@ -138,25 +507,6 @@ QVariantMap BuildConsoleBuildStep::toMap() const
|
||||
|
||||
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);
|
||||
@@ -185,87 +535,78 @@ QString BuildConsoleBuildStep::normalizeWinVerArgument(QString winVer)
|
||||
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);
|
||||
m_activeCommandBuilder->keepJobNum(m_keepJobNum->value());
|
||||
QString cmd("/Command= %0");
|
||||
cmd = cmd.arg(m_activeCommandBuilder->fullCommandFlag());
|
||||
args.append(cmd);
|
||||
|
||||
if (!m_profileXml.isEmpty())
|
||||
args.append(QString("/Profile=" + m_profileXml));
|
||||
if (!m_profileXml->value().isEmpty())
|
||||
args.append("/Profile=" + m_profileXml->value());
|
||||
|
||||
args.append(QString("/AvoidLocal=%1").arg(m_avoidLocal ? QString("ON") : QString("OFF")));
|
||||
args.append(QString("/AvoidLocal=%1").arg(m_avoidLocal->value() ? QString("ON") : QString("OFF")));
|
||||
|
||||
if (m_maxCpu > 0)
|
||||
args.append(QString("/MaxCPUs=%1").arg(m_maxCpu));
|
||||
if (m_maxCpu->value() > 0)
|
||||
args.append(QString("/MaxCPUs=%1").arg(m_maxCpu->value()));
|
||||
|
||||
if (!m_maxWinVer.isEmpty())
|
||||
args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(m_maxWinVer)));
|
||||
if (!m_maxWinVer->stringValue().isEmpty())
|
||||
args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(m_maxWinVer->stringValue())));
|
||||
|
||||
if (!m_minWinVer.isEmpty())
|
||||
args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(m_minWinVer)));
|
||||
if (!m_minWinVer->stringValue().isEmpty())
|
||||
args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(m_minWinVer->stringValue())));
|
||||
|
||||
if (!m_title.isEmpty())
|
||||
args.append(QString("/Title=" + m_title));
|
||||
if (!m_title->value().isEmpty())
|
||||
args.append(QString("/Title=" + m_title->value()));
|
||||
|
||||
if (!m_monFile.isEmpty())
|
||||
args.append(QString("/Mon=" + m_monFile));
|
||||
if (!m_monFile->value().isEmpty())
|
||||
args.append(QString("/Mon=" + m_monFile->value()));
|
||||
|
||||
if (m_suppressStdOut)
|
||||
if (m_suppressStdOut->value())
|
||||
args.append("/Silent");
|
||||
|
||||
if (!m_logFile.isEmpty())
|
||||
args.append(QString("/Log=" + m_logFile));
|
||||
if (!m_logFile->value().isEmpty())
|
||||
args.append(QString("/Log=" + m_logFile->value()));
|
||||
|
||||
if (m_showCmd)
|
||||
if (m_showCmd->value())
|
||||
args.append("/ShowCmd");
|
||||
|
||||
if (m_showAgents)
|
||||
if (m_showAgents->value())
|
||||
args.append("/ShowAgent");
|
||||
|
||||
if (m_showAgents)
|
||||
if (m_showAgents->value())
|
||||
args.append("/ShowTime");
|
||||
|
||||
if (m_hideHeader)
|
||||
if (m_hideHeader->value())
|
||||
args.append("/NoLogo");
|
||||
|
||||
if (!m_logLevel.isEmpty())
|
||||
args.append(QString("/LogLevel=" + m_logLevel));
|
||||
if (!m_logLevel->stringValue().isEmpty())
|
||||
args.append(QString("/LogLevel=" + m_logLevel->stringValue()));
|
||||
|
||||
if (!m_setEnv.isEmpty())
|
||||
args.append(QString("/SetEnv=" + m_setEnv));
|
||||
if (!m_setEnv->value().isEmpty())
|
||||
args.append(QString("/SetEnv=" + m_setEnv->value()));
|
||||
|
||||
if (m_stopOnError)
|
||||
if (m_stopOnError->value())
|
||||
args.append("/StopOnErrors");
|
||||
|
||||
if (!m_additionalArguments.isEmpty())
|
||||
args.append(m_additionalArguments);
|
||||
if (!m_additionalArguments->value().isEmpty())
|
||||
args.append(m_additionalArguments->value());
|
||||
|
||||
if (m_openMonitor)
|
||||
if (m_openMonitor->value())
|
||||
args.append("/OpenMonitor");
|
||||
|
||||
Utils::CommandLine cmdLine("BuildConsole.exe", args);
|
||||
CommandLine cmdLine("BuildConsole.exe", args);
|
||||
ProcessParameters* procParams = processParameters();
|
||||
procParams->setCommandLine(cmdLine);
|
||||
procParams->setEnvironment(Utils::Environment::systemEnvironment());
|
||||
procParams->setEnvironment(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);
|
||||
procParams->setMacroExpander(buildConfig->macroExpander());
|
||||
}
|
||||
|
||||
return AbstractProcessStep::init();
|
||||
@@ -273,29 +614,18 @@ bool BuildConsoleBuildStep::init()
|
||||
|
||||
BuildStepConfigWidget* BuildConsoleBuildStep::createConfigWidget()
|
||||
{
|
||||
// On first creation of the step, attempt to detect and migrate from preceding steps
|
||||
if (!m_loadedFromMap)
|
||||
tryToMigrate();
|
||||
|
||||
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)
|
||||
for (CommandBuilder *p : m_commandBuilders)
|
||||
list.push_back(p->displayName());
|
||||
}
|
||||
|
||||
@@ -304,7 +634,7 @@ const QStringList& BuildConsoleBuildStep::supportedCommandBuilders()
|
||||
|
||||
void BuildConsoleBuildStep::commandBuilder(const QString& commandBuilder)
|
||||
{
|
||||
for (CommandBuilder* p : m_commandBuildersList) {
|
||||
for (CommandBuilder *p : m_commandBuilders) {
|
||||
if (p->displayName().compare(commandBuilder) == 0) {
|
||||
m_activeCommandBuilder = p;
|
||||
break;
|
||||
@@ -312,5 +642,16 @@ void BuildConsoleBuildStep::commandBuilder(const QString& commandBuilder)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// BuildConsoleStepFactory
|
||||
|
||||
BuildConsoleStepFactory::BuildConsoleStepFactory()
|
||||
{
|
||||
registerStep<BuildConsoleBuildStep>(IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID);
|
||||
setDisplayName(QObject::tr("IncrediBuild for Windows"));
|
||||
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
|
||||
ProjectExplorer::Constants::BUILDSTEPS_CLEAN});
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace IncrediBuild
|
||||
|
@@ -25,125 +25,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandbuilder.h"
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
|
||||
#include <QList>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace IncrediBuild {
|
||||
namespace Internal {
|
||||
|
||||
class BuildConsoleBuildStep : public ProjectExplorer::AbstractProcessStep
|
||||
class BuildConsoleStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BuildConsoleBuildStep(ProjectExplorer::BuildStepList *buildStepList, Utils::Id id);
|
||||
~BuildConsoleBuildStep() override;
|
||||
|
||||
bool init() override;
|
||||
|
||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
||||
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
bool avoidLocal() const { return m_avoidLocal; }
|
||||
void avoidLocal(bool avoidLocal) { m_avoidLocal = avoidLocal; }
|
||||
|
||||
const QString &profileXml() const { return m_profileXml; }
|
||||
void profileXml(const QString &profileXml) { m_profileXml = profileXml; }
|
||||
|
||||
int maxCpu() const { return m_maxCpu; }
|
||||
void maxCpu(int maxCpu) { m_maxCpu = maxCpu; }
|
||||
|
||||
const QStringList& supportedWindowsVersions() const;
|
||||
const QString &maxWinVer() const { return m_maxWinVer; }
|
||||
void maxWinVer(const QString &maxWinVer) { m_maxWinVer = maxWinVer; }
|
||||
|
||||
const QString &minWinVer() const { return m_minWinVer; }
|
||||
void minWinVer(const QString &minWinVer) { m_minWinVer = minWinVer; }
|
||||
|
||||
const QString &title() const { return m_title; }
|
||||
void title(const QString &title) { m_title = title; }
|
||||
|
||||
const QString &monFile() const { return m_monFile; }
|
||||
void monFile(const QString &monFile) { m_monFile = monFile; }
|
||||
|
||||
bool suppressStdOut() const { return m_suppressStdOut; }
|
||||
void suppressStdOut(bool suppressStdOut) { m_suppressStdOut = suppressStdOut; }
|
||||
|
||||
const QString &logFile() const { return m_logFile; }
|
||||
void logFile(const QString &logFile) { m_logFile = logFile; }
|
||||
|
||||
bool showCmd() const { return m_showCmd; }
|
||||
void showCmd(bool showCmd) { m_showCmd = showCmd; }
|
||||
|
||||
bool showAgents() const { return m_showAgents; }
|
||||
void showAgents(bool showAgents) { m_showAgents = showAgents; }
|
||||
|
||||
bool showTime() const { return m_showTime; }
|
||||
void showTime(bool showTime) { m_showTime = showTime; }
|
||||
|
||||
bool hideHeader() const { return m_hideHeader; }
|
||||
void hideHeader(bool hideHeader) { m_hideHeader = hideHeader; }
|
||||
|
||||
const QStringList& supportedLogLevels() const;
|
||||
const QString &logLevel() const { return m_logLevel; }
|
||||
void logLevel(const QString &logLevel) { m_logLevel = logLevel; }
|
||||
|
||||
const QString &setEnv() const { return m_setEnv; }
|
||||
void setEnv(const QString &setEnv) { m_setEnv = setEnv; }
|
||||
|
||||
bool stopOnError() const { return m_stopOnError; }
|
||||
void stopOnError(bool stopOnError) { m_stopOnError = stopOnError; }
|
||||
|
||||
const QString &additionalArguments() const { return m_additionalArguments; }
|
||||
void additionalArguments(const QString &additionalArguments) { m_additionalArguments = additionalArguments; }
|
||||
|
||||
bool openMonitor() const { return m_openMonitor; }
|
||||
void openMonitor(bool openMonitor) { m_openMonitor = openMonitor; }
|
||||
|
||||
bool keepJobNum() const { return m_keepJobNum; }
|
||||
void keepJobNum(bool keepJobNum) { m_keepJobNum = keepJobNum; }
|
||||
|
||||
const QStringList& supportedCommandBuilders();
|
||||
CommandBuilder *commandBuilder() const { return m_activeCommandBuilder; }
|
||||
void commandBuilder(const QString &commandBuilder);
|
||||
|
||||
bool loadedFromMap() const { return m_loadedFromMap; }
|
||||
void tryToMigrate();
|
||||
|
||||
void setupOutputFormatter(Utils::OutputFormatter *formatter) override;
|
||||
|
||||
private:
|
||||
void initCommandBuilders();
|
||||
QString normalizeWinVerArgument(QString winVer);
|
||||
|
||||
ProjectExplorer::BuildStepList *m_earlierSteps{};
|
||||
bool m_loadedFromMap{false};
|
||||
bool m_avoidLocal{false};
|
||||
QString m_profileXml{};
|
||||
int m_maxCpu{0};
|
||||
QString m_maxWinVer{};
|
||||
QString m_minWinVer{};
|
||||
QString m_title{};
|
||||
QString m_monFile{};
|
||||
bool m_suppressStdOut{false};
|
||||
QString m_logFile{};
|
||||
bool m_showCmd{false};
|
||||
bool m_showAgents{false};
|
||||
bool m_showTime{false};
|
||||
bool m_hideHeader{false};
|
||||
QString m_logLevel{};
|
||||
QString m_setEnv{};
|
||||
bool m_stopOnError{false};
|
||||
QString m_additionalArguments{};
|
||||
bool m_openMonitor{true};
|
||||
bool m_keepJobNum{false};
|
||||
CommandBuilder* m_activeCommandBuilder{};
|
||||
QList<CommandBuilder*> m_commandBuildersList{};
|
||||
BuildConsoleStepFactory();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -1,356 +0,0 @@
|
||||
<?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>867</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="additionalArgsLabel">
|
||||
<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><html><head/><body><p><span style=" font-style:italic; color:#ff0000;">Please enter the appropriate arguments to your build command.</span></p></body></html></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><html><head/><body><p>Setting this option to true, forces IncrediBuild to not override the -j command line switch. </p><p>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).</p></body></html></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><html><head/><body><p><span style=" font-style:italic; color:#ff0000;">Please make sure the build command's multi-job parameter value is large enough (such as -J200 for the JOM or Make build tools)</span></p></body></html></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>
|
@@ -1,297 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
@@ -1,76 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
@@ -1,56 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
@@ -1,44 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
@@ -9,16 +9,12 @@ DEFINES += INCREDIBUILD_LIBRARY
|
||||
|
||||
SOURCES += incredibuildplugin.cpp \
|
||||
buildconsolebuildstep.cpp \
|
||||
buildconsolestepfactory.cpp \
|
||||
buildconsolestepconfigwidget.cpp \
|
||||
commandbuilder.cpp \
|
||||
makecommandbuilder.cpp \
|
||||
cmakecommandbuilder.cpp \
|
||||
ibconsolebuildstep.cpp
|
||||
|
||||
HEADERS += incredibuildplugin.h \
|
||||
buildconsolestepconfigwidget.h \
|
||||
buildconsolestepfactory.h \
|
||||
cmakecommandbuilder.h \
|
||||
commandbuilder.h \
|
||||
incredibuild_global.h \
|
||||
@@ -26,6 +22,3 @@ HEADERS += incredibuildplugin.h \
|
||||
buildconsolebuildstep.h \
|
||||
makecommandbuilder.h \
|
||||
ibconsolebuildstep.h \
|
||||
|
||||
FORMS += \
|
||||
buildconsolebuildstep.ui
|
||||
|
@@ -11,11 +11,6 @@ QtcPlugin {
|
||||
files: [
|
||||
"buildconsolebuildstep.cpp",
|
||||
"buildconsolebuildstep.h",
|
||||
"buildconsolebuildstep.ui",
|
||||
"buildconsolestepconfigwidget.cpp",
|
||||
"buildconsolestepconfigwidget.h",
|
||||
"buildconsolestepfactory.cpp",
|
||||
"buildconsolestepfactory.h",
|
||||
"cmakecommandbuilder.cpp",
|
||||
"cmakecommandbuilder.h",
|
||||
"commandbuilder.cpp",
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "incredibuild_global.h"
|
||||
#include "buildconsolestepfactory.h"
|
||||
#include "buildconsolebuildstep.h"
|
||||
#include "ibconsolebuildstep.h"
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
@@ -81,6 +81,7 @@ public:
|
||||
QPointer<QComboBox> m_comboBox;
|
||||
QPointer<QLabel> m_label;
|
||||
QPointer<QButtonGroup> m_buttonGroup;
|
||||
QString m_tooltip;
|
||||
};
|
||||
|
||||
class BaseStringAspectPrivate
|
||||
@@ -602,7 +603,9 @@ void BaseSelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
break;
|
||||
case DisplayStyle::ComboBox:
|
||||
d->m_label = new QLabel(displayName());
|
||||
d->m_label->setToolTip(d->m_tooltip);
|
||||
d->m_comboBox = new QComboBox;
|
||||
d->m_comboBox->setToolTip(d->m_tooltip);
|
||||
for (int i = 0, n = d->m_options.size(); i < n; ++i)
|
||||
d->m_comboBox->addItem(d->m_options.at(i).displayName);
|
||||
connect(d->m_comboBox.data(), QOverload<int>::of(&QComboBox::activated), this,
|
||||
@@ -648,6 +651,11 @@ void BaseSelectionAspect::setDisplayStyle(BaseSelectionAspect::DisplayStyle styl
|
||||
d->m_displayStyle = style;
|
||||
}
|
||||
|
||||
void BaseSelectionAspect::setToolTip(const QString &tooltip)
|
||||
{
|
||||
d->m_tooltip = tooltip;
|
||||
}
|
||||
|
||||
int BaseSelectionAspect::value() const
|
||||
{
|
||||
return d->m_value;
|
||||
@@ -663,6 +671,11 @@ void BaseSelectionAspect::setValue(int value)
|
||||
}
|
||||
}
|
||||
|
||||
QString BaseSelectionAspect::stringValue() const
|
||||
{
|
||||
return d->m_options.at(d->m_value).displayName;
|
||||
}
|
||||
|
||||
void BaseSelectionAspect::addOption(const QString &displayName, const QString &toolTip)
|
||||
{
|
||||
d->m_options.append({displayName, toolTip});
|
||||
|
@@ -90,12 +90,16 @@ public:
|
||||
int value() const;
|
||||
void setValue(int val);
|
||||
|
||||
QString stringValue() const;
|
||||
|
||||
int defaultValue() const;
|
||||
void setDefaultValue(int defaultValue);
|
||||
|
||||
enum class DisplayStyle { RadioButtons, ComboBox };
|
||||
void setDisplayStyle(DisplayStyle style);
|
||||
|
||||
void setToolTip(const QString &tooltip);
|
||||
|
||||
void addOption(const QString &displayName, const QString &toolTip = {});
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
|
Reference in New Issue
Block a user