Incredibuild: Auto-register aspects in build steps

Change-Id: Ic36ac230c92df4b18649aa19a57f7a424a593db3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-06-01 15:23:53 +02:00
parent 37d2240dfc
commit 35c60cd7b4
4 changed files with 214 additions and 217 deletions

View File

@@ -2346,16 +2346,12 @@ void IntegersAspect::setDefaultValue(const QList<int> &value)
A text display does not have a real value. A text display does not have a real value.
*/ */
TextDisplay::TextDisplay(AspectContainer *container)
: BaseAspect(container), d(new Internal::TextDisplayPrivate)
{}
/*! /*!
Constructs a text display showing the \a message with an icon representing Constructs a text display showing the \a message with an icon representing
type \a type. type \a type.
*/ */
TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type) TextDisplay::TextDisplay(AspectContainer *container, const QString &message, InfoLabel::InfoType type)
: d(new Internal::TextDisplayPrivate) : BaseAspect(container), d(new Internal::TextDisplayPrivate)
{ {
d->m_message = message; d->m_message = message;
d->m_type = type; d->m_type = type;

View File

@@ -610,9 +610,9 @@ class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect
Q_OBJECT Q_OBJECT
public: public:
explicit TextDisplay(AspectContainer *container); explicit TextDisplay(AspectContainer *container,
TextDisplay(const QString &message = {}, const QString &message = {},
InfoLabel::InfoType type = InfoLabel::None); InfoLabel::InfoType type = InfoLabel::None);
~TextDisplay() override; ~TextDisplay() override;
void addToLayout(Layouting::LayoutItem &parent) override; void addToLayout(Layouting::LayoutItem &parent) override;

View File

@@ -50,6 +50,39 @@ public:
BuildConsoleBuildStep(BuildStepList *buildStepList, Id id); BuildConsoleBuildStep(BuildStepList *buildStepList, Id id);
void setupOutputFormatter(OutputFormatter *formatter) final; void setupOutputFormatter(OutputFormatter *formatter) final;
TextDisplay t1{this, "<b>" + Tr::tr("Target and Configuration")};
CommandBuilderAspect commandBuilder{this};
TextDisplay t2{this, "<i>" + Tr::tr("Enter the appropriate arguments to your build command.")};
TextDisplay t3{this, "<i>" + Tr::tr("Make sure the build command's multi-job "
"parameter value is large enough "
"(such as -j200 for the JOM or Make build tools)")};
BoolAspect keepJobNum{this};
TextDisplay t4{this, "<b>" + Tr::tr("IncrediBuild Distribution Control")};
FilePathAspect profileXml{this};
BoolAspect avoidLocal{this};
IntegerAspect maxCpu{this};
SelectionAspect maxWinVer{this};
SelectionAspect minWinVer{this};
TextDisplay t5{this, "<b>" + Tr::tr("Output and Logging")};
StringAspect title{this};
FilePathAspect monFile{this};
BoolAspect suppressStdOut{this};
FilePathAspect logFile{this};
BoolAspect showCmd{this};
BoolAspect showAgents{this};
BoolAspect showTime{this};
BoolAspect hideHeader{this};
SelectionAspect logLevel{this};
TextDisplay t6{this, "<b>" + Tr::tr("Miscellaneous")};
StringAspect setEnv{this};
BoolAspect stopOnError{this};
StringAspect additionalArguments{this};
BoolAspect openMonitor{this};
}; };
BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id) BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id)
@@ -57,230 +90,197 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
{ {
setDisplayName(Tr::tr("IncrediBuild for Windows")); setDisplayName(Tr::tr("IncrediBuild for Windows"));
addAspect<TextDisplay>("<b>" + Tr::tr("Target and Configuration")); commandBuilder.setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder");
auto commandBuilder = addAspect<CommandBuilderAspect>(this); keepJobNum.setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum");
commandBuilder->setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder"); keepJobNum.setLabel(Tr::tr("Keep original jobs number:"));
keepJobNum.setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, "
"that controls the number of parallel spawned tasks. The default "
"IncrediBuild behavior is to set it to 200."));
addAspect<TextDisplay>("<i>" + Tr::tr("Enter the appropriate arguments to your build command.")); profileXml.setSettingsKey("IncrediBuild.BuildConsole.ProfileXml");
addAspect<TextDisplay>("<i>" + Tr::tr("Make sure the build command's multi-job " profileXml.setLabelText(Tr::tr("Profile.xml:"));
"parameter value is large enough " profileXml.setExpectedKind(PathChooser::Kind::File);
"(such as -j200 for the JOM or Make build tools)")); profileXml.setBaseFileName(PathChooser::homePath());
profileXml.setHistoryCompleter("IncrediBuild.BuildConsole.ProfileXml.History");
profileXml.setToolTip(Tr::tr("Defines 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."));
auto keepJobNum = addAspect<BoolAspect>(); avoidLocal.setSettingsKey("IncrediBuild.BuildConsole.AvoidLocal");
keepJobNum->setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum"); avoidLocal.setLabel(Tr::tr("Avoid local task execution:"));
keepJobNum->setLabel(Tr::tr("Keep original jobs number:")); avoidLocal.setToolTip(Tr::tr("Overrides the Agent Settings dialog Avoid task execution on local "
keepJobNum->setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, " "machine when possible option. This allows to free more resources "
"that controls the number of parallel spawned tasks. The default " "on the initiator machine and could be beneficial to distribution "
"IncrediBuild behavior is to set it to 200.")); "in scenarios where the initiating machine is bottlenecking the "
"build with High CPU usage."));
addAspect<TextDisplay>("<b>" + Tr::tr("IncrediBuild Distribution Control")); maxCpu.setSettingsKey("IncrediBuild.BuildConsole.MaxCpu");
maxCpu.setToolTip(Tr::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."));
maxCpu.setLabel(Tr::tr("Maximum CPUs to utilize in the build:"));
maxCpu.setRange(0, 65536);
auto profileXml = addAspect<FilePathAspect>(); maxWinVer.setSettingsKey("IncrediBuild.BuildConsole.MaxWinVer");
profileXml->setSettingsKey("IncrediBuild.BuildConsole.ProfileXml"); maxWinVer.setDisplayName(Tr::tr("Newest allowed helper machine OS:"));
profileXml->setLabelText(Tr::tr("Profile.xml:")); maxWinVer.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
profileXml->setExpectedKind(PathChooser::Kind::File); maxWinVer.setToolTip(Tr::tr("Specifies the newest operating system installed on a helper "
profileXml->setBaseFileName(PathChooser::homePath()); "machine to be allowed to participate as helper in the build."));
profileXml->setHistoryCompleter("IncrediBuild.BuildConsole.ProfileXml.History");
profileXml->setToolTip(Tr::tr("Defines 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."));
auto avoidLocal = addAspect<BoolAspect>();
avoidLocal->setSettingsKey("IncrediBuild.BuildConsole.AvoidLocal");
avoidLocal->setLabel(Tr::tr("Avoid local task execution:"));
avoidLocal->setToolTip(Tr::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."));
auto maxCpu = addAspect<IntegerAspect>();
maxCpu->setSettingsKey("IncrediBuild.BuildConsole.MaxCpu");
maxCpu->setToolTip(Tr::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."));
maxCpu->setLabel(Tr::tr("Maximum CPUs to utilize in the build:"));
maxCpu->setRange(0, 65536);
auto maxWinVer = addAspect<SelectionAspect>();
maxWinVer->setSettingsKey("IncrediBuild.BuildConsole.MaxWinVer");
maxWinVer->setDisplayName(Tr::tr("Newest allowed helper machine OS:"));
maxWinVer->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
maxWinVer->setToolTip(Tr::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()) for (const QString &version : supportedWindowsVersions())
maxWinVer->addOption(version); maxWinVer.addOption(version);
auto minWinVer = addAspect<SelectionAspect>(); minWinVer.setSettingsKey("IncrediBuild.BuildConsole.MinWinVer");
minWinVer->setSettingsKey("IncrediBuild.BuildConsole.MinWinVer"); minWinVer.setDisplayName(Tr::tr("Oldest allowed helper machine OS:"));
minWinVer->setDisplayName(Tr::tr("Oldest allowed helper machine OS:")); minWinVer.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
minWinVer->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); minWinVer.setToolTip(Tr::tr("Specifies the oldest operating system installed on a helper "
minWinVer->setToolTip(Tr::tr("Specifies the oldest operating system installed on a helper " "machine to be allowed to participate as helper in the build."));
"machine to be allowed to participate as helper in the build."));
for (const QString &version : supportedWindowsVersions()) for (const QString &version : supportedWindowsVersions())
minWinVer->addOption(version); minWinVer.addOption(version);
addAspect<TextDisplay>("<b>" + Tr::tr("Output and Logging")); title.setSettingsKey("IncrediBuild.BuildConsole.Title");
title.setLabelText(Tr::tr("Build title:"));
title.setDisplayStyle(StringAspect::LineEditDisplay);
title.setToolTip(Tr::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."));
auto title = addAspect<StringAspect>(); monFile.setSettingsKey("IncrediBuild.BuildConsole.MonFile");
title->setSettingsKey("IncrediBuild.BuildConsole.Title"); monFile.setLabelText(Tr::tr("Save IncrediBuild monitor file:"));
title->setLabelText(Tr::tr("Build title:")); monFile.setExpectedKind(PathChooser::Kind::Any);
title->setDisplayStyle(StringAspect::LineEditDisplay); monFile.setBaseFileName(PathChooser::homePath());
title->setToolTip(Tr::tr("Specifies a custom header line which will be displayed in the " monFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History"));
"beginning of the build output text. This title will also be used " monFile.setToolTip(Tr::tr("Writes a copy of the build progress file (.ib_mon) to the specified "
"for the Build History and Build Monitor displays.")); "location. If only a folder name is given, a generated GUID will serve "
"as the file name. The full path of the saved Build Monitor will be "
"written to the end of the build output."));
auto monFile = addAspect<FilePathAspect>(); suppressStdOut.setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut");
monFile->setSettingsKey("IncrediBuild.BuildConsole.MonFile"); suppressStdOut.setLabel(Tr::tr("Suppress STDOUT:"));
monFile->setLabelText(Tr::tr("Save IncrediBuild monitor file:")); suppressStdOut.setToolTip(Tr::tr("Does not write anything to the standard output."));
monFile->setExpectedKind(PathChooser::Kind::Any);
monFile->setBaseFileName(PathChooser::homePath());
monFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History"));
monFile->setToolTip(Tr::tr("Writes a copy of the build progress file (.ib_mon) to the specified "
"location. If only a folder name is given, a generated GUID will serve "
"as the file name. The full path of the saved Build Monitor will be "
"written to the end of the build output."));
auto suppressStdOut = addAspect<BoolAspect>(); logFile.setSettingsKey("IncrediBuild.BuildConsole.LogFile");
suppressStdOut->setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut"); logFile.setLabelText(Tr::tr("Output Log file:"));
suppressStdOut->setLabel(Tr::tr("Suppress STDOUT:")); logFile.setExpectedKind(PathChooser::Kind::SaveFile);
suppressStdOut->setToolTip(Tr::tr("Does not write anything to the standard output.")); logFile.setBaseFileName(PathChooser::homePath());
logFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History"));
logFile.setToolTip(Tr::tr("Writes build output to a file."));
auto logFile = addAspect<FilePathAspect>(); showCmd.setSettingsKey("IncrediBuild.BuildConsole.ShowCmd");
logFile->setSettingsKey("IncrediBuild.BuildConsole.LogFile"); showCmd.setLabel(Tr::tr("Show Commands in output:"));
logFile->setLabelText(Tr::tr("Output Log file:")); showCmd.setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild "
logFile->setExpectedKind(PathChooser::Kind::SaveFile); "to build the file."));
logFile->setBaseFileName(PathChooser::homePath());
logFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History"));
logFile->setToolTip(Tr::tr("Writes build output to a file."));
auto showCmd = addAspect<BoolAspect>(); showAgents.setSettingsKey("IncrediBuild.BuildConsole.ShowAgents");
showCmd->setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); showAgents.setLabel(Tr::tr("Show Agents in output:"));
showCmd->setLabel(Tr::tr("Show Commands in output:")); showAgents.setToolTip(Tr::tr("Shows the Agent used to build each file."));
showCmd->setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild "
"to build the file."));
auto showAgents = addAspect<BoolAspect>(); showTime.setSettingsKey("IncrediBuild.BuildConsole.ShowTime");
showAgents->setSettingsKey("IncrediBuild.BuildConsole.ShowAgents"); showTime.setLabel(Tr::tr("Show Time in output:"));
showAgents->setLabel(Tr::tr("Show Agents in output:")); showTime.setToolTip(Tr::tr("Shows the Start and Finish time for each file built."));
showAgents->setToolTip(Tr::tr("Shows the Agent used to build each file."));
auto showTime = addAspect<BoolAspect>(); hideHeader.setSettingsKey("IncrediBuild.BuildConsole.HideHeader");
showTime->setSettingsKey("IncrediBuild.BuildConsole.ShowTime"); hideHeader.setLabel(Tr::tr("Hide IncrediBuild Header in output:"));
showTime->setLabel(Tr::tr("Show Time in output:")); hideHeader.setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output"));
showTime->setToolTip(Tr::tr("Shows the Start and Finish time for each file built."));
auto hideHeader = addAspect<BoolAspect>(); logLevel.setSettingsKey("IncrediBuild.BuildConsole.LogLevel");
hideHeader->setSettingsKey("IncrediBuild.BuildConsole.HideHeader"); logLevel.setDisplayName(Tr::tr("Internal IncrediBuild logging level:"));
hideHeader->setLabel(Tr::tr("Hide IncrediBuild Header in output:")); logLevel.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
hideHeader->setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output")); logLevel.addOption(QString());
logLevel.addOption("Minimal");
logLevel.addOption("Extended");
logLevel.addOption("Detailed");
logLevel.setToolTip(Tr::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"));
auto logLevel = addAspect<SelectionAspect>(); setEnv.setSettingsKey("IncrediBuild.BuildConsole.SetEnv");
logLevel->setSettingsKey("IncrediBuild.BuildConsole.LogLevel"); setEnv.setLabelText(Tr::tr("Set an Environment Variable:"));
logLevel->setDisplayName(Tr::tr("Internal IncrediBuild logging level:")); setEnv.setDisplayStyle(StringAspect::LineEditDisplay);
logLevel->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); setEnv.setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build."));
logLevel->addOption(QString());
logLevel->addOption("Minimal");
logLevel->addOption("Extended");
logLevel->addOption("Detailed");
logLevel->setToolTip(Tr::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"));
addAspect<TextDisplay>("<b>" + Tr::tr("Miscellaneous")); stopOnError.setSettingsKey("IncrediBuild.BuildConsole.StopOnError");
stopOnError.setLabel(Tr::tr("Stop on errors:"));
stopOnError.setToolTip(Tr::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"));
auto setEnv = addAspect<StringAspect>(); additionalArguments.setSettingsKey("IncrediBuild.BuildConsole.AdditionalArguments");
setEnv->setSettingsKey("IncrediBuild.BuildConsole.SetEnv"); additionalArguments.setLabelText(Tr::tr("Additional Arguments:"));
setEnv->setLabelText(Tr::tr("Set an Environment Variable:")); additionalArguments.setDisplayStyle(StringAspect::LineEditDisplay);
setEnv->setDisplayStyle(StringAspect::LineEditDisplay); additionalArguments.setToolTip(Tr::tr("Add additional buildconsole arguments manually. "
setEnv->setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build.")); "The value of this field will be concatenated to the "
"final buildconsole command line"));
auto stopOnError = addAspect<BoolAspect>(); openMonitor.setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor");
stopOnError->setSettingsKey("IncrediBuild.BuildConsole.StopOnError"); openMonitor.setLabel(Tr::tr("Open Build Monitor:"));
stopOnError->setLabel(Tr::tr("Stop on errors:")); openMonitor.setToolTip(Tr::tr("Opens Build Monitor once the build starts."));
stopOnError->setToolTip(Tr::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"));
auto additionalArguments = addAspect<StringAspect>(); setCommandLineProvider([this] {
additionalArguments->setSettingsKey("IncrediBuild.BuildConsole.AdditionalArguments");
additionalArguments->setLabelText(Tr::tr("Additional Arguments:"));
additionalArguments->setDisplayStyle(StringAspect::LineEditDisplay);
additionalArguments->setToolTip(Tr::tr("Add additional buildconsole arguments manually. "
"The value of this field will be concatenated to the "
"final buildconsole command line"));
auto openMonitor = addAspect<BoolAspect>();
openMonitor->setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor");
openMonitor->setLabel(Tr::tr("Open Build Monitor:"));
openMonitor->setToolTip(Tr::tr("Opens Build Monitor once the build starts."));
setCommandLineProvider([=] {
QStringList args; QStringList args;
QString cmd("/Command= %1"); QString cmd("/Command= %1");
cmd = cmd.arg(commandBuilder->fullCommandFlag(keepJobNum->value())); cmd = cmd.arg(commandBuilder.fullCommandFlag(keepJobNum()));
args.append(cmd); args.append(cmd);
if (!profileXml->value().isEmpty()) if (!profileXml().isEmpty())
args.append("/Profile=" + profileXml->value()); args.append("/Profile=" + profileXml().path());
args.append(QString("/AvoidLocal=%1").arg(avoidLocal->value() ? QString("ON") : QString("OFF"))); args.append(QString("/AvoidLocal=%1").arg(avoidLocal() ? QString("ON") : QString("OFF")));
if (maxCpu->value() > 0) if (maxCpu() > 0)
args.append(QString("/MaxCPUs=%1").arg(maxCpu->value())); args.append(QString("/MaxCPUs=%1").arg(maxCpu()));
if (!maxWinVer->stringValue().isEmpty()) if (!maxWinVer.stringValue().isEmpty())
args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer->stringValue()))); args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer.stringValue())));
if (!minWinVer->stringValue().isEmpty()) if (!minWinVer.stringValue().isEmpty())
args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer->stringValue()))); args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer.stringValue())));
if (!title->value().isEmpty()) if (!title().isEmpty())
args.append(QString("/Title=" + title->value())); args.append("/Title=" + title());
if (!monFile->value().isEmpty()) if (!monFile().isEmpty())
args.append(QString("/Mon=" + monFile->value())); args.append("/Mon=" + monFile().path());
if (suppressStdOut->value()) if (suppressStdOut())
args.append("/Silent"); args.append("/Silent");
if (!logFile->value().isEmpty()) if (!logFile().isEmpty())
args.append(QString("/Log=" + logFile->value())); args.append("/Log=" + logFile().path());
if (showCmd->value()) if (showCmd())
args.append("/ShowCmd"); args.append("/ShowCmd");
if (showAgents->value()) if (showAgents())
args.append("/ShowAgent"); args.append("/ShowAgent");
if (showAgents->value()) if (showAgents())
args.append("/ShowTime"); args.append("/ShowTime");
if (hideHeader->value()) if (hideHeader())
args.append("/NoLogo"); args.append("/NoLogo");
if (!logLevel->stringValue().isEmpty()) if (!logLevel.stringValue().isEmpty())
args.append(QString("/LogLevel=" + logLevel->stringValue())); args.append("/LogLevel=" + logLevel.stringValue());
if (!setEnv->value().isEmpty()) if (!setEnv().isEmpty())
args.append(QString("/SetEnv=" + setEnv->value())); args.append("/SetEnv=" + setEnv());
if (stopOnError->value()) if (stopOnError())
args.append("/StopOnErrors"); args.append("/StopOnErrors");
if (!additionalArguments->value().isEmpty()) if (!additionalArguments().isEmpty())
args.append(additionalArguments->value()); args.append(additionalArguments());
if (openMonitor->value()) if (openMonitor())
args.append("/OpenMonitor"); args.append("/OpenMonitor");
return CommandLine("BuildConsole.exe", args); return CommandLine("BuildConsole.exe", args);

View File

@@ -28,6 +28,21 @@ public:
IBConsoleBuildStep(BuildStepList *buildStepList, Id id); IBConsoleBuildStep(BuildStepList *buildStepList, Id id);
void setupOutputFormatter(OutputFormatter *formatter) final; void setupOutputFormatter(OutputFormatter *formatter) final;
TextDisplay t1{this, "<b>" + Tr::tr("Target and Configuration")};
CommandBuilderAspect commandBuilder{this};
BoolAspect keepJobNum{this};
TextDisplay t2{this, "<i>" + Tr::tr("Enter the appropriate arguments to your build command.")};
TextDisplay t3{this, "<i>" + Tr::tr("Make sure the build command's "
"multi-job parameter value is large enough (such as "
"-j200 for the JOM or Make build tools)")};
TextDisplay t4{this, "<b>" + Tr::tr("IncrediBuild Distribution Control")};
IntegerAspect nice{this};
BoolAspect forceRemote{this};
BoolAspect alternate{this};
}; };
IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id)
@@ -35,52 +50,38 @@ IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id)
{ {
setDisplayName(Tr::tr("IncrediBuild for Linux")); setDisplayName(Tr::tr("IncrediBuild for Linux"));
addAspect<TextDisplay>("<b>" + Tr::tr("Target and Configuration")); commandBuilder.setSettingsKey("IncrediBuild.IBConsole.CommandBuilder");
auto commandBuilder = addAspect<CommandBuilderAspect>(this); keepJobNum.setSettingsKey("IncrediBuild.IBConsole.KeepJobNum");
commandBuilder->setSettingsKey("IncrediBuild.IBConsole.CommandBuilder"); keepJobNum.setLabel(Tr::tr("Keep original jobs number:"));
keepJobNum.setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, "
"that controls the number of parallel spawned tasks. The default "
"IncrediBuild behavior is to set it to 200."));
addAspect<TextDisplay>("<i>" + Tr::tr("Enter the appropriate arguments to your build command.")); nice.setSettingsKey("IncrediBuild.IBConsole.Nice");
addAspect<TextDisplay>("<i>" + Tr::tr("Make sure the build command's " nice.setToolTip(Tr::tr("Specify nice value. Nice Value should be numeric and between -20 and 19"));
"multi-job parameter value is large enough (such as " nice.setLabel(Tr::tr("Nice value:"));
"-j200 for the JOM or Make build tools)")); nice.setRange(-20, 19);
auto keepJobNum = addAspect<BoolAspect>(); forceRemote.setSettingsKey("IncrediBuild.IBConsole.Alternate");
keepJobNum->setSettingsKey("IncrediBuild.IBConsole.KeepJobNum"); forceRemote.setLabel(Tr::tr("Force remote:"));
keepJobNum->setLabel(Tr::tr("Keep original jobs number:"));
keepJobNum->setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, "
"that controls the number of parallel spawned tasks. The default "
"IncrediBuild behavior is to set it to 200."));
addAspect<TextDisplay>("<b>" + Tr::tr("IncrediBuild Distribution Control")); alternate.setSettingsKey("IncrediBuild.IBConsole.ForceRemote");
alternate.setLabel(Tr::tr("Alternate tasks preference:"));
auto nice = addAspect<IntegerAspect>(); setCommandLineProvider([this] {
nice->setSettingsKey("IncrediBuild.IBConsole.Nice");
nice->setToolTip(Tr::tr("Specify nice value. Nice Value should be numeric and between -20 and 19"));
nice->setLabel(Tr::tr("Nice value:"));
nice->setRange(-20, 19);
auto forceRemote = addAspect<BoolAspect>();
forceRemote->setSettingsKey("IncrediBuild.IBConsole.Alternate");
forceRemote->setLabel(Tr::tr("Force remote:"));
auto alternate = addAspect<BoolAspect>();
alternate->setSettingsKey("IncrediBuild.IBConsole.ForceRemote");
alternate->setLabel(Tr::tr("Alternate tasks preference:"));
setCommandLineProvider([=] {
QStringList args; QStringList args;
if (nice->value() != 0) if (nice() != 0)
args.append(QString("--nice %1 ").arg(nice->value())); args.append(QString("--nice %1 ").arg(nice()));
if (alternate->value()) if (alternate())
args.append("--alternate"); args.append("--alternate");
if (forceRemote->value()) if (forceRemote())
args.append("--force-remote"); args.append("--force-remote");
args.append(commandBuilder->fullCommandFlag(keepJobNum->value())); args.append(commandBuilder.fullCommandFlag(keepJobNum()));
return CommandLine("ib_console", args); return CommandLine("ib_console", args);
}); });