diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5ba4922d668..4c824df6015 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2346,16 +2346,12 @@ void IntegersAspect::setDefaultValue(const QList &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 type \a type. */ -TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type) - : d(new Internal::TextDisplayPrivate) +TextDisplay::TextDisplay(AspectContainer *container, const QString &message, InfoLabel::InfoType type) + : BaseAspect(container), d(new Internal::TextDisplayPrivate) { d->m_message = message; d->m_type = type; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index b99c28c0bef..297842b3787 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -610,9 +610,9 @@ class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect Q_OBJECT public: - explicit TextDisplay(AspectContainer *container); - TextDisplay(const QString &message = {}, - InfoLabel::InfoType type = InfoLabel::None); + explicit TextDisplay(AspectContainer *container, + const QString &message = {}, + InfoLabel::InfoType type = InfoLabel::None); ~TextDisplay() override; void addToLayout(Layouting::LayoutItem &parent) override; diff --git a/src/plugins/incredibuild/buildconsolebuildstep.cpp b/src/plugins/incredibuild/buildconsolebuildstep.cpp index c28c1cd6769..d654ebd25e1 100644 --- a/src/plugins/incredibuild/buildconsolebuildstep.cpp +++ b/src/plugins/incredibuild/buildconsolebuildstep.cpp @@ -50,6 +50,39 @@ public: BuildConsoleBuildStep(BuildStepList *buildStepList, Id id); void setupOutputFormatter(OutputFormatter *formatter) final; + + TextDisplay t1{this, "" + Tr::tr("Target and Configuration")}; + CommandBuilderAspect commandBuilder{this}; + + TextDisplay t2{this, "" + Tr::tr("Enter the appropriate arguments to your build command.")}; + TextDisplay t3{this, "" + 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, "" + Tr::tr("IncrediBuild Distribution Control")}; + FilePathAspect profileXml{this}; + BoolAspect avoidLocal{this}; + IntegerAspect maxCpu{this}; + SelectionAspect maxWinVer{this}; + SelectionAspect minWinVer{this}; + + TextDisplay t5{this, "" + 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, "" + Tr::tr("Miscellaneous")}; + StringAspect setEnv{this}; + BoolAspect stopOnError{this}; + StringAspect additionalArguments{this}; + BoolAspect openMonitor{this}; }; BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id) @@ -57,230 +90,197 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id { setDisplayName(Tr::tr("IncrediBuild for Windows")); - addAspect("" + Tr::tr("Target and Configuration")); + commandBuilder.setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder"); - auto commandBuilder = addAspect(this); - commandBuilder->setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder"); + keepJobNum.setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum"); + 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("" + Tr::tr("Enter the appropriate arguments to your build command.")); - addAspect("" + 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)")); + profileXml.setSettingsKey("IncrediBuild.BuildConsole.ProfileXml"); + profileXml.setLabelText(Tr::tr("Profile.xml:")); + profileXml.setExpectedKind(PathChooser::Kind::File); + 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(); - keepJobNum->setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum"); - 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.")); + 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.")); - addAspect("" + 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(); - profileXml->setSettingsKey("IncrediBuild.BuildConsole.ProfileXml"); - profileXml->setLabelText(Tr::tr("Profile.xml:")); - profileXml->setExpectedKind(PathChooser::Kind::File); - 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 avoidLocal = addAspect(); - 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(); - 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(); - 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.")); + 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()) - maxWinVer->addOption(version); + maxWinVer.addOption(version); - auto minWinVer = addAspect(); - minWinVer->setSettingsKey("IncrediBuild.BuildConsole.MinWinVer"); - minWinVer->setDisplayName(Tr::tr("Oldest allowed helper machine OS:")); - minWinVer->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - minWinVer->setToolTip(Tr::tr("Specifies the oldest operating system installed on a helper " - "machine to be allowed to participate as helper in the build.")); + minWinVer.setSettingsKey("IncrediBuild.BuildConsole.MinWinVer"); + minWinVer.setDisplayName(Tr::tr("Oldest allowed helper machine OS:")); + minWinVer.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + minWinVer.setToolTip(Tr::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()) - minWinVer->addOption(version); + minWinVer.addOption(version); - addAspect("" + 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(); - 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.")); + monFile.setSettingsKey("IncrediBuild.BuildConsole.MonFile"); + monFile.setLabelText(Tr::tr("Save IncrediBuild monitor file:")); + 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 monFile = addAspect(); - monFile->setSettingsKey("IncrediBuild.BuildConsole.MonFile"); - monFile->setLabelText(Tr::tr("Save IncrediBuild monitor file:")); - 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.")); + suppressStdOut.setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut"); + suppressStdOut.setLabel(Tr::tr("Suppress STDOUT:")); + suppressStdOut.setToolTip(Tr::tr("Does not write anything to the standard output.")); - auto suppressStdOut = addAspect(); - suppressStdOut->setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut"); - suppressStdOut->setLabel(Tr::tr("Suppress STDOUT:")); - suppressStdOut->setToolTip(Tr::tr("Does not write anything to the standard output.")); + logFile.setSettingsKey("IncrediBuild.BuildConsole.LogFile"); + logFile.setLabelText(Tr::tr("Output Log file:")); + logFile.setExpectedKind(PathChooser::Kind::SaveFile); + logFile.setBaseFileName(PathChooser::homePath()); + logFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History")); + logFile.setToolTip(Tr::tr("Writes build output to a file.")); - auto logFile = addAspect(); - logFile->setSettingsKey("IncrediBuild.BuildConsole.LogFile"); - logFile->setLabelText(Tr::tr("Output Log file:")); - logFile->setExpectedKind(PathChooser::Kind::SaveFile); - logFile->setBaseFileName(PathChooser::homePath()); - logFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History")); - logFile->setToolTip(Tr::tr("Writes build output to a file.")); + showCmd.setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); + showCmd.setLabel(Tr::tr("Show Commands in output:")); + showCmd.setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild " + "to build the file.")); - auto showCmd = addAspect(); - showCmd->setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); - showCmd->setLabel(Tr::tr("Show Commands in output:")); - showCmd->setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild " - "to build the file.")); + showAgents.setSettingsKey("IncrediBuild.BuildConsole.ShowAgents"); + showAgents.setLabel(Tr::tr("Show Agents in output:")); + showAgents.setToolTip(Tr::tr("Shows the Agent used to build each file.")); - auto showAgents = addAspect(); - showAgents->setSettingsKey("IncrediBuild.BuildConsole.ShowAgents"); - showAgents->setLabel(Tr::tr("Show Agents in output:")); - showAgents->setToolTip(Tr::tr("Shows the Agent used to build each file.")); + showTime.setSettingsKey("IncrediBuild.BuildConsole.ShowTime"); + showTime.setLabel(Tr::tr("Show Time in output:")); + showTime.setToolTip(Tr::tr("Shows the Start and Finish time for each file built.")); - auto showTime = addAspect(); - showTime->setSettingsKey("IncrediBuild.BuildConsole.ShowTime"); - showTime->setLabel(Tr::tr("Show Time in output:")); - showTime->setToolTip(Tr::tr("Shows the Start and Finish time for each file built.")); + hideHeader.setSettingsKey("IncrediBuild.BuildConsole.HideHeader"); + hideHeader.setLabel(Tr::tr("Hide IncrediBuild Header in output:")); + hideHeader.setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output")); - auto hideHeader = addAspect(); - hideHeader->setSettingsKey("IncrediBuild.BuildConsole.HideHeader"); - hideHeader->setLabel(Tr::tr("Hide IncrediBuild Header in output:")); - hideHeader->setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output")); + logLevel.setSettingsKey("IncrediBuild.BuildConsole.LogLevel"); + logLevel.setDisplayName(Tr::tr("Internal IncrediBuild logging level:")); + logLevel.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + 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(); - logLevel->setSettingsKey("IncrediBuild.BuildConsole.LogLevel"); - logLevel->setDisplayName(Tr::tr("Internal IncrediBuild logging level:")); - logLevel->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - 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")); + setEnv.setSettingsKey("IncrediBuild.BuildConsole.SetEnv"); + setEnv.setLabelText(Tr::tr("Set an Environment Variable:")); + setEnv.setDisplayStyle(StringAspect::LineEditDisplay); + setEnv.setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build.")); - addAspect("" + 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(); - setEnv->setSettingsKey("IncrediBuild.BuildConsole.SetEnv"); - setEnv->setLabelText(Tr::tr("Set an Environment Variable:")); - setEnv->setDisplayStyle(StringAspect::LineEditDisplay); - setEnv->setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build.")); + 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 stopOnError = addAspect(); - 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")); + openMonitor.setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor"); + openMonitor.setLabel(Tr::tr("Open Build Monitor:")); + openMonitor.setToolTip(Tr::tr("Opens Build Monitor once the build starts.")); - auto additionalArguments = addAspect(); - 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(); - openMonitor->setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor"); - openMonitor->setLabel(Tr::tr("Open Build Monitor:")); - openMonitor->setToolTip(Tr::tr("Opens Build Monitor once the build starts.")); - - setCommandLineProvider([=] { + setCommandLineProvider([this] { QStringList args; QString cmd("/Command= %1"); - cmd = cmd.arg(commandBuilder->fullCommandFlag(keepJobNum->value())); + cmd = cmd.arg(commandBuilder.fullCommandFlag(keepJobNum())); args.append(cmd); - if (!profileXml->value().isEmpty()) - args.append("/Profile=" + profileXml->value()); + if (!profileXml().isEmpty()) + 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) - args.append(QString("/MaxCPUs=%1").arg(maxCpu->value())); + if (maxCpu() > 0) + args.append(QString("/MaxCPUs=%1").arg(maxCpu())); - if (!maxWinVer->stringValue().isEmpty()) - args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer->stringValue()))); + if (!maxWinVer.stringValue().isEmpty()) + args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer.stringValue()))); - if (!minWinVer->stringValue().isEmpty()) - args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer->stringValue()))); + if (!minWinVer.stringValue().isEmpty()) + args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer.stringValue()))); - if (!title->value().isEmpty()) - args.append(QString("/Title=" + title->value())); + if (!title().isEmpty()) + args.append("/Title=" + title()); - if (!monFile->value().isEmpty()) - args.append(QString("/Mon=" + monFile->value())); + if (!monFile().isEmpty()) + args.append("/Mon=" + monFile().path()); - if (suppressStdOut->value()) + if (suppressStdOut()) args.append("/Silent"); - if (!logFile->value().isEmpty()) - args.append(QString("/Log=" + logFile->value())); + if (!logFile().isEmpty()) + args.append("/Log=" + logFile().path()); - if (showCmd->value()) + if (showCmd()) args.append("/ShowCmd"); - if (showAgents->value()) + if (showAgents()) args.append("/ShowAgent"); - if (showAgents->value()) + if (showAgents()) args.append("/ShowTime"); - if (hideHeader->value()) + if (hideHeader()) args.append("/NoLogo"); - if (!logLevel->stringValue().isEmpty()) - args.append(QString("/LogLevel=" + logLevel->stringValue())); + if (!logLevel.stringValue().isEmpty()) + args.append("/LogLevel=" + logLevel.stringValue()); - if (!setEnv->value().isEmpty()) - args.append(QString("/SetEnv=" + setEnv->value())); + if (!setEnv().isEmpty()) + args.append("/SetEnv=" + setEnv()); - if (stopOnError->value()) + if (stopOnError()) args.append("/StopOnErrors"); - if (!additionalArguments->value().isEmpty()) - args.append(additionalArguments->value()); + if (!additionalArguments().isEmpty()) + args.append(additionalArguments()); - if (openMonitor->value()) + if (openMonitor()) args.append("/OpenMonitor"); return CommandLine("BuildConsole.exe", args); diff --git a/src/plugins/incredibuild/ibconsolebuildstep.cpp b/src/plugins/incredibuild/ibconsolebuildstep.cpp index 3bd453fdb8c..c53ffad4552 100644 --- a/src/plugins/incredibuild/ibconsolebuildstep.cpp +++ b/src/plugins/incredibuild/ibconsolebuildstep.cpp @@ -28,6 +28,21 @@ public: IBConsoleBuildStep(BuildStepList *buildStepList, Id id); void setupOutputFormatter(OutputFormatter *formatter) final; + + TextDisplay t1{this, "" + Tr::tr("Target and Configuration")}; + CommandBuilderAspect commandBuilder{this}; + BoolAspect keepJobNum{this}; + + TextDisplay t2{this, "" + Tr::tr("Enter the appropriate arguments to your build command.")}; + TextDisplay t3{this, "" + 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, "" + Tr::tr("IncrediBuild Distribution Control")}; + + IntegerAspect nice{this}; + BoolAspect forceRemote{this}; + BoolAspect alternate{this}; }; IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) @@ -35,52 +50,38 @@ IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) { setDisplayName(Tr::tr("IncrediBuild for Linux")); - addAspect("" + Tr::tr("Target and Configuration")); + commandBuilder.setSettingsKey("IncrediBuild.IBConsole.CommandBuilder"); - auto commandBuilder = addAspect(this); - commandBuilder->setSettingsKey("IncrediBuild.IBConsole.CommandBuilder"); + keepJobNum.setSettingsKey("IncrediBuild.IBConsole.KeepJobNum"); + 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("" + Tr::tr("Enter the appropriate arguments to your build command.")); - addAspect("" + 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)")); + 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 keepJobNum = addAspect(); - keepJobNum->setSettingsKey("IncrediBuild.IBConsole.KeepJobNum"); - 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.")); + forceRemote.setSettingsKey("IncrediBuild.IBConsole.Alternate"); + forceRemote.setLabel(Tr::tr("Force remote:")); - addAspect("" + Tr::tr("IncrediBuild Distribution Control")); + alternate.setSettingsKey("IncrediBuild.IBConsole.ForceRemote"); + alternate.setLabel(Tr::tr("Alternate tasks preference:")); - auto nice = addAspect(); - 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(); - forceRemote->setSettingsKey("IncrediBuild.IBConsole.Alternate"); - forceRemote->setLabel(Tr::tr("Force remote:")); - - auto alternate = addAspect(); - alternate->setSettingsKey("IncrediBuild.IBConsole.ForceRemote"); - alternate->setLabel(Tr::tr("Alternate tasks preference:")); - - setCommandLineProvider([=] { + setCommandLineProvider([this] { QStringList args; - if (nice->value() != 0) - args.append(QString("--nice %1 ").arg(nice->value())); + if (nice() != 0) + args.append(QString("--nice %1 ").arg(nice())); - if (alternate->value()) + if (alternate()) args.append("--alternate"); - if (forceRemote->value()) + if (forceRemote()) args.append("--force-remote"); - args.append(commandBuilder->fullCommandFlag(keepJobNum->value())); + args.append(commandBuilder.fullCommandFlag(keepJobNum())); return CommandLine("ib_console", args); });