IncrediBuild: Finish buildstep aspectification

Change-Id: I7135ff47e4c117bf8917cfbd7c90b1e0ba527145
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-08-06 16:48:43 +02:00
parent 52b2ca55c9
commit f00b088a1d
5 changed files with 95 additions and 208 deletions

View File

@@ -29,8 +29,6 @@
#include "commandbuilderaspect.h" #include "commandbuilderaspect.h"
#include "incredibuildconstants.h" #include "incredibuildconstants.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/gnumakeparser.h> #include <projectexplorer/gnumakeparser.h>
@@ -39,16 +37,8 @@
#include <projectexplorer/projectconfigurationaspects.h> #include <projectexplorer/projectconfigurationaspects.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/pathchooser.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QCheckBox>
#include <QComboBox>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -86,14 +76,11 @@ public:
BuildConsoleBuildStep(BuildStepList *buildStepList, Id id); BuildConsoleBuildStep(BuildStepList *buildStepList, Id id);
bool init() final; bool init() final;
BuildStepConfigWidget *createConfigWidget() final;
void setupOutputFormatter(OutputFormatter *formatter) final; void setupOutputFormatter(OutputFormatter *formatter) final;
const QStringList &supportedWindowsVersions() const; const QStringList &supportedWindowsVersions() const;
QString normalizeWinVerArgument(QString winVer);
bool m_loadedFromMap{false};
private:
CommandBuilderAspect *m_commandBuilder; CommandBuilderAspect *m_commandBuilder;
BaseBoolAspect *m_avoidLocal{nullptr}; BaseBoolAspect *m_avoidLocal{nullptr};
BaseStringAspect *m_profileXml{nullptr}; BaseStringAspect *m_profileXml{nullptr};
@@ -116,105 +103,32 @@ public:
BaseBoolAspect *m_keepJobNum{nullptr}; BaseBoolAspect *m_keepJobNum{nullptr};
}; };
class BuildConsoleStepConfigWidget : public BuildStepConfigWidget
{
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::BuildConsoleBuildStep)
public:
explicit BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep);
};
// BuildConsoleStepConfigWidget
BuildConsoleStepConfigWidget::BuildConsoleStepConfigWidget(BuildConsoleBuildStep *buildConsoleStep)
: BuildStepConfigWidget(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);
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);
LayoutBuilder builder(this);
builder.addRow(sectionTarget);
builder.addRow(buildConsoleStep->m_commandBuilder);
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());
}
// BuildConsoleBuilStep
BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id) BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id)
: AbstractProcessStep(buildStepList, id) : AbstractProcessStep(buildStepList, id)
{ {
setDisplayName("IncrediBuild for Windows"); setDisplayName(tr("IncrediBuild for Windows"));
addAspect<TextDisplay>("<b>" + tr("Target and Configuration"));
m_commandBuilder = addAspect<CommandBuilderAspect>(this); m_commandBuilder = addAspect<CommandBuilderAspect>(this);
m_commandBuilder->setSettingsKey(Constants::BUILDCONSOLE_COMMANDBUILDER); m_commandBuilder->setSettingsKey(Constants::BUILDCONSOLE_COMMANDBUILDER);
m_maxCpu = addAspect<BaseIntegerAspect>(); addAspect<TextDisplay>("<i>" + tr("Enter the appropriate arguments to your build command."));
m_maxCpu->setSettingsKey(Constants::BUILDCONSOLE_MAXCPU); addAspect<TextDisplay>("<i>" + tr("Make sure the build command's multi-job "
m_maxCpu->setToolTip(tr("Determines the maximum number of CPU cores that can be used in a " "parameter value is large enough "
"build, regardless of the number of available Agents. " "(such as -j200 for the JOM or Make build tools)"));
"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_keepJobNum = addAspect<BaseBoolAspect>();
m_avoidLocal->setSettingsKey(Constants::BUILDCONSOLE_AVOIDLOCAL); m_keepJobNum->setSettingsKey(Constants::BUILDCONSOLE_KEEPJOBNUM);
m_avoidLocal->setLabel(tr("Avoid Local:"), BaseBoolAspect::LabelPlacement::InExtraLabel); m_keepJobNum->setLabel(tr("Keep Original Jobs Num:"));
m_avoidLocal->setToolTip(tr("Overrides the Agent Settings dialog Avoid task execution on local " m_keepJobNum->setToolTip(tr("Setting this option to true, forces IncrediBuild to not override "
"machine when possible option. This allows to free more resources " "the -j command line switch.<p>The default IncrediBuild "
"on the initiator machine and could be beneficial to distribution " "behavior is to set a high value to the -j command line switch "
"in scenarios where the initiating machine is bottlenecking the " "which controls the number of processes that the build tools "
"build with High CPU usage.")); "executed by Qt Creator will execute in parallel (the default "
"IncrediBuild behavior will set this value to 200)"));
addAspect<TextDisplay>("<b>" + tr("IncrediBuild Distribution Control"));
m_profileXml = addAspect<BaseStringAspect>(); m_profileXml = addAspect<BaseStringAspect>();
m_profileXml->setSettingsKey(Constants::BUILDCONSOLE_PROFILEXML); m_profileXml->setSettingsKey(Constants::BUILDCONSOLE_PROFILEXML);
@@ -226,12 +140,30 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
m_profileXml->setToolTip(tr("The Profile XML file is used to define how Automatic " m_profileXml->setToolTip(tr("The Profile XML file is used to define how Automatic "
"Interception Interface should handle the various processes " "Interception Interface should handle the various processes "
"involved in a distributed job. It is not necessary for " "involved in a distributed job. It is not necessary for "
"\"Visual Studio\" or \"InExtraLabel and Build tools\" builds, " "\"Visual Studio\" or \"Make and Build tools\" builds, "
"but can be used to provide configuration options if those " "but can be used to provide configuration options if those "
"builds use additional processes that are not included in " "builds use additional processes that are not included in "
"those packages. It is required to configure distributable " "those packages. It is required to configure distributable "
"processes in \"Dev Tools\" builds.")); "processes in \"Dev Tools\" builds."));
m_avoidLocal = addAspect<BaseBoolAspect>();
m_avoidLocal->setSettingsKey(Constants::BUILDCONSOLE_AVOIDLOCAL);
m_avoidLocal->setLabel(tr("Avoid Local:"));
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_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_maxWinVer = addAspect<BaseSelectionAspect>(); m_maxWinVer = addAspect<BaseSelectionAspect>();
m_maxWinVer->setSettingsKey(Constants::BUILDCONSOLE_MAXWINVER); m_maxWinVer->setSettingsKey(Constants::BUILDCONSOLE_MAXWINVER);
m_maxWinVer->setDisplayName(tr("Newest allowed helper machine OS:")); m_maxWinVer->setDisplayName(tr("Newest allowed helper machine OS:"));
@@ -250,6 +182,8 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
for (const QString &version : supportedWindowsVersions()) for (const QString &version : supportedWindowsVersions())
m_minWinVer->addOption(version); m_minWinVer->addOption(version);
addAspect<TextDisplay>("<b>" + tr("Output and Logging"));
m_title = addAspect<BaseStringAspect>(); m_title = addAspect<BaseStringAspect>();
m_title->setSettingsKey(Constants::BUILDCONSOLE_TITLE); m_title->setSettingsKey(Constants::BUILDCONSOLE_TITLE);
m_title->setLabelText(tr("Build Title:")); m_title->setLabelText(tr("Build Title:"));
@@ -272,8 +206,7 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
m_suppressStdOut = addAspect<BaseBoolAspect>(); m_suppressStdOut = addAspect<BaseBoolAspect>();
m_suppressStdOut->setSettingsKey(Constants::BUILDCONSOLE_SUPPRESSSTDOUT); m_suppressStdOut->setSettingsKey(Constants::BUILDCONSOLE_SUPPRESSSTDOUT);
m_suppressStdOut->setLabel(tr("Suppress STDOUT:"), m_suppressStdOut->setLabel(tr("Suppress STDOUT:"));
BaseBoolAspect::LabelPlacement::InExtraLabel);
m_suppressStdOut->setToolTip(tr("Does not write anything to the standard output.")); m_suppressStdOut->setToolTip(tr("Does not write anything to the standard output."));
m_logFile = addAspect<BaseStringAspect>(); m_logFile = addAspect<BaseStringAspect>();
@@ -287,27 +220,23 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
m_showCmd = addAspect<BaseBoolAspect>(); m_showCmd = addAspect<BaseBoolAspect>();
m_showCmd->setSettingsKey(Constants::BUILDCONSOLE_SHOWCMD); m_showCmd->setSettingsKey(Constants::BUILDCONSOLE_SHOWCMD);
m_showCmd->setLabel(tr("Show Commands in output:"), 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 " m_showCmd->setToolTip(tr("Shows, for each file built, the command-line used by IncrediBuild "
"to build the file.")); "to build the file."));
m_showAgents = addAspect<BaseBoolAspect>(); m_showAgents = addAspect<BaseBoolAspect>();
m_showAgents->setSettingsKey(Constants::BUILDCONSOLE_SHOWAGENTS); m_showAgents->setSettingsKey(Constants::BUILDCONSOLE_SHOWAGENTS);
m_showAgents->setLabel(tr("Show Agents in output:"), m_showAgents->setLabel(tr("Show Agents in output:"));
BaseBoolAspect::LabelPlacement::InExtraLabel);
m_showAgents->setToolTip(tr("Shows the Agent used to build each file.")); m_showAgents->setToolTip(tr("Shows the Agent used to build each file."));
m_showTime = addAspect<BaseBoolAspect>(); m_showTime = addAspect<BaseBoolAspect>();
m_showTime->setSettingsKey(Constants::BUILDCONSOLE_SHOWTIME); m_showTime->setSettingsKey(Constants::BUILDCONSOLE_SHOWTIME);
m_showTime->setLabel(tr("Show Time in output:"), 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_showTime->setToolTip(tr("Shows the Start and Finish time for each file built."));
m_hideHeader = addAspect<BaseBoolAspect>(); m_hideHeader = addAspect<BaseBoolAspect>();
m_hideHeader->setSettingsKey(Constants::BUILDCONSOLE_HIDEHEADER); m_hideHeader->setSettingsKey(Constants::BUILDCONSOLE_HIDEHEADER);
m_hideHeader->setLabel(tr("Hide IncrediBuild Header in output:"), 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_hideHeader->setToolTip(tr("Suppresses the \"IncrediBuild\" header in the build output"));
m_logLevel = addAspect<BaseSelectionAspect>(); m_logLevel = addAspect<BaseSelectionAspect>();
@@ -322,6 +251,8 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
"Does not affect output or any user accessible logging. Used mainly " "Does not affect output or any user accessible logging. Used mainly "
"to troubleshoot issues with the help of IncrediBuild support")); "to troubleshoot issues with the help of IncrediBuild support"));
addAspect<TextDisplay>("<b>" + tr("Miscellaneous"));
m_setEnv = addAspect<BaseStringAspect>(); m_setEnv = addAspect<BaseStringAspect>();
m_setEnv->setSettingsKey(Constants::BUILDCONSOLE_SETENV); m_setEnv->setSettingsKey(Constants::BUILDCONSOLE_SETENV);
m_setEnv->setLabelText(tr("Set an Environment Variable:")); m_setEnv->setLabelText(tr("Set an Environment Variable:"));
@@ -330,7 +261,7 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
m_stopOnError = addAspect<BaseBoolAspect>(); m_stopOnError = addAspect<BaseBoolAspect>();
m_stopOnError->setSettingsKey(Constants::BUILDCONSOLE_STOPONERROR); m_stopOnError->setSettingsKey(Constants::BUILDCONSOLE_STOPONERROR);
m_stopOnError->setLabel(tr("Stop On Errors:"), BaseBoolAspect::LabelPlacement::InExtraLabel); m_stopOnError->setLabel(tr("Stop On Errors:"));
m_stopOnError->setToolTip(tr("When specified, the execution will stop as soon as an error " m_stopOnError->setToolTip(tr("When specified, the execution will stop as soon as an error "
"is encountered. This is the default behavior in " "is encountered. This is the default behavior in "
"\"Visual Studio\" builds, but not the default for " "\"Visual Studio\" builds, but not the default for "
@@ -347,20 +278,10 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
m_openMonitor = addAspect<BaseBoolAspect>(); m_openMonitor = addAspect<BaseBoolAspect>();
m_openMonitor->setSettingsKey(Constants::BUILDCONSOLE_OPENMONITOR); m_openMonitor->setSettingsKey(Constants::BUILDCONSOLE_OPENMONITOR);
m_openMonitor->setLabel(tr("Open Monitor:"), BaseBoolAspect::LabelPlacement::InExtraLabel); m_openMonitor->setLabel(tr("Open Monitor:"));
m_openMonitor->setToolTip(tr("Opens an IncrediBuild Build Monitor that graphically displays " m_openMonitor->setToolTip(tr("Opens an IncrediBuild Build Monitor that graphically displays "
"the build progress once the build starts.")); "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::setupOutputFormatter(OutputFormatter *formatter) void BuildConsoleBuildStep::setupOutputFormatter(OutputFormatter *formatter)
@@ -385,7 +306,7 @@ const QStringList& BuildConsoleBuildStep::supportedWindowsVersions() const
return list; return list;
} }
QString BuildConsoleBuildStep::normalizeWinVerArgument(QString winVer) static QString normalizeWinVerArgument(QString winVer)
{ {
winVer.remove("Windows "); winVer.remove("Windows ");
winVer.remove("Server "); winVer.remove("Server ");
@@ -470,17 +391,12 @@ bool BuildConsoleBuildStep::init()
return AbstractProcessStep::init(); return AbstractProcessStep::init();
} }
BuildStepConfigWidget* BuildConsoleBuildStep::createConfigWidget()
{
return new BuildConsoleStepConfigWidget(this);
}
// BuildConsoleStepFactory // BuildConsoleStepFactory
BuildConsoleStepFactory::BuildConsoleStepFactory() BuildConsoleStepFactory::BuildConsoleStepFactory()
{ {
registerStep<BuildConsoleBuildStep>(IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID); registerStep<BuildConsoleBuildStep>(IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID);
setDisplayName(QObject::tr("IncrediBuild for Windows")); setDisplayName(BuildConsoleBuildStep::tr("IncrediBuild for Windows"));
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD, setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
ProjectExplorer::Constants::BUILDSTEPS_CLEAN}); ProjectExplorer::Constants::BUILDSTEPS_CLEAN});
} }

View File

@@ -230,5 +230,16 @@ void CommandBuilderAspect::toMap(QVariantMap &map) const
d->m_activeCommandBuilder->toMap(&map); d->m_activeCommandBuilder->toMap(&map);
} }
// TextDisplay
void TextDisplay::addToLayout(LayoutBuilder &builder)
{
if (!m_label) {
m_label = new QLabel(m_message);
m_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
}
builder.addItem(m_label.data());
}
} // namespace Internal } // namespace Internal
} // namespace IncrediBuild } // namespace IncrediBuild

View File

@@ -28,6 +28,9 @@
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
#include <projectexplorer/projectconfigurationaspects.h> #include <projectexplorer/projectconfigurationaspects.h>
#include <QLabel>
#include <QPointer>
namespace IncrediBuild { namespace IncrediBuild {
namespace Internal { namespace Internal {
@@ -49,5 +52,17 @@ private:
class CommandBuilderAspectPrivate *d = nullptr; class CommandBuilderAspectPrivate *d = nullptr;
}; };
class TextDisplay final : public ProjectExplorer::ProjectConfigurationAspect
{
public:
TextDisplay(const QString &message) : m_message(message) {}
private:
void addToLayout(ProjectExplorer::LayoutBuilder &builder) final;
QString m_message;
QPointer<QLabel> m_label;
};
} // namespace Internal } // namespace Internal
} // namespace IncrediBuild } // namespace IncrediBuild

View File

@@ -29,19 +29,14 @@
#include "commandbuilderaspect.h" #include "commandbuilderaspect.h"
#include "incredibuildconstants.h" #include "incredibuildconstants.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/gnumakeparser.h> #include <projectexplorer/gnumakeparser.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/processparameters.h> #include <projectexplorer/processparameters.h>
#include <projectexplorer/projectconfigurationaspects.h> #include <projectexplorer/projectconfigurationaspects.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <QLabel>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -56,16 +51,6 @@ const QLatin1String IBCONSOLE_FORCEREMOTE("IncrediBuild.IBConsole.ForceRemote");
const QLatin1String IBCONSOLE_ALTERNATE("IncrediBuild.IBConsole.Alternate"); const QLatin1String IBCONSOLE_ALTERNATE("IncrediBuild.IBConsole.Alternate");
} }
class IBConsoleBuildStep;
class IBConsoleStepConfigWidget : public BuildStepConfigWidget
{
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::IBConsoleBuildStep)
public:
explicit IBConsoleStepConfigWidget(IBConsoleBuildStep *ibConsoleStep);
};
class IBConsoleBuildStep final : public AbstractProcessStep class IBConsoleBuildStep final : public AbstractProcessStep
{ {
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::IBConsoleBuildStep) Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::IBConsoleBuildStep)
@@ -74,74 +59,30 @@ public:
IBConsoleBuildStep(BuildStepList *buildStepList, Id id); IBConsoleBuildStep(BuildStepList *buildStepList, Id id);
bool init() final; bool init() final;
BuildStepConfigWidget *createConfigWidget() final;
void setupOutputFormatter(OutputFormatter *formatter) final; void setupOutputFormatter(OutputFormatter *formatter) final;
public: private:
CommandBuilderAspect *m_commandBuilder; CommandBuilderAspect *m_commandBuilder;
BaseIntegerAspect *m_nice{nullptr}; BaseIntegerAspect *m_nice{nullptr};
BaseBoolAspect *m_keepJobNum{nullptr}; BaseBoolAspect *m_keepJobNum{nullptr};
BaseBoolAspect *m_forceRemote{nullptr}; BaseBoolAspect *m_forceRemote{nullptr};
BaseBoolAspect *m_alternate{nullptr}; BaseBoolAspect *m_alternate{nullptr};
BuildStepList *m_earlierSteps{};
}; };
IBConsoleStepConfigWidget::IBConsoleStepConfigWidget(IBConsoleBuildStep *ibConsoleStep)
: BuildStepConfigWidget(ibConsoleStep)
{
setDisplayName(tr("IncrediBuild for Linux"));
setSummaryText("<b>" + displayName() + "</b>");
QFont font;
font.setBold(true);
font.setWeight(75);
auto section1 = new QLabel("Target and configuration", this);
section1->setFont(font);
auto section2 = new QLabel(this);
section2->setText(tr("IncrediBuild Distribution control"));
section2->setFont(font);
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);
LayoutBuilder builder(this);
builder.addRow(section1);
builder.addRow(ibConsoleStep->m_commandBuilder);
builder.addRow(infoLabel1);
builder.addRow(infoLabel2);
builder.addRow(ibConsoleStep->m_keepJobNum);
builder.addRow(section2);
builder.addRow(ibConsoleStep->m_nice);
builder.addRow(ibConsoleStep->m_forceRemote);
builder.addRow(ibConsoleStep->m_alternate);
Core::VariableChooser::addSupportForChildWidgets(this, ibConsoleStep->macroExpander());
}
// IBConsoleBuildStep
IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id)
: AbstractProcessStep(buildStepList, id) : AbstractProcessStep(buildStepList, id)
, m_earlierSteps(buildStepList)
{ {
setDisplayName("IncrediBuild for Linux"); setDisplayName(tr("IncrediBuild for Linux"));
addAspect<TextDisplay>("<b>" + tr("Target and Configuration"));
m_commandBuilder = addAspect<CommandBuilderAspect>(this); m_commandBuilder = addAspect<CommandBuilderAspect>(this);
m_commandBuilder->setSettingsKey(Constants::IBCONSOLE_COMMANDBUILDER); m_commandBuilder->setSettingsKey(Constants::IBCONSOLE_COMMANDBUILDER);
m_nice = addAspect<BaseIntegerAspect>(); addAspect<TextDisplay>("<i>" + tr("Enter the appropriate arguments to your build command."));
m_nice->setSettingsKey(Constants::IBCONSOLE_NICE); addAspect<TextDisplay>("<i>" + tr("Make sure the build command's "
m_nice->setToolTip(tr("Specify nice value. Nice Value should be numeric and between -20 and 19")); "multi-job parameter value is large enough (such as "
m_nice->setLabel(tr("Nice value:")); "-j200 for the JOM or Make build tools)"));
m_nice->setRange(-20, 19);
m_keepJobNum = addAspect<BaseBoolAspect>(); m_keepJobNum = addAspect<BaseBoolAspect>();
m_keepJobNum->setSettingsKey(Constants::IBCONSOLE_KEEPJOBNUM); m_keepJobNum->setSettingsKey(Constants::IBCONSOLE_KEEPJOBNUM);
@@ -153,6 +94,14 @@ IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id)
"execute in parallel (the default IncrediBuild behavior will set " "execute in parallel (the default IncrediBuild behavior will set "
"this value to 200).")); "this value to 200)."));
addAspect<TextDisplay>("<b>" + tr("IncrediBuild Distribution Control"));
m_nice = addAspect<BaseIntegerAspect>();
m_nice->setSettingsKey(Constants::IBCONSOLE_NICE);
m_nice->setToolTip(tr("Specify nice value. Nice Value should be numeric and between -20 and 19"));
m_nice->setLabel(tr("Nice value:"));
m_nice->setRange(-20, 19);
m_forceRemote = addAspect<BaseBoolAspect>(); m_forceRemote = addAspect<BaseBoolAspect>();
m_forceRemote->setSettingsKey(Constants::IBCONSOLE_ALTERNATE); m_forceRemote->setSettingsKey(Constants::IBCONSOLE_ALTERNATE);
m_forceRemote->setLabel(tr("Force remote:")); m_forceRemote->setLabel(tr("Force remote:"));
@@ -202,18 +151,13 @@ bool IBConsoleBuildStep::init()
return AbstractProcessStep::init(); return AbstractProcessStep::init();
} }
BuildStepConfigWidget *IBConsoleBuildStep::createConfigWidget()
{
return new IBConsoleStepConfigWidget(this);
}
// IBConsoleStepFactory // IBConsoleStepFactory
IBConsoleStepFactory::IBConsoleStepFactory() IBConsoleStepFactory::IBConsoleStepFactory()
{ {
registerStep<IBConsoleBuildStep>(IncrediBuild::Constants::IBCONSOLE_BUILDSTEP_ID); registerStep<IBConsoleBuildStep>(IncrediBuild::Constants::IBCONSOLE_BUILDSTEP_ID);
setDisplayName(QObject::tr("IncrediBuild for Linux")); setDisplayName(IBConsoleBuildStep::tr("IncrediBuild for Linux"));
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD, setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
ProjectExplorer::Constants::BUILDSTEPS_CLEAN}); ProjectExplorer::Constants::BUILDSTEPS_CLEAN});
} }

View File

@@ -46,6 +46,7 @@ class BaseIntegerAspectPrivate;
class BaseSelectionAspectPrivate; class BaseSelectionAspectPrivate;
class BaseStringAspectPrivate; class BaseStringAspectPrivate;
class BaseStringListAspectPrivate; class BaseStringListAspectPrivate;
class TextDisplayPrivate;
} // Internal } // Internal
class PROJECTEXPLORER_EXPORT BaseBoolAspect : public ProjectConfigurationAspect class PROJECTEXPLORER_EXPORT BaseBoolAspect : public ProjectConfigurationAspect