bool DMakeStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); if (!bc) bc = target()->activeBuildConfiguration(); m_tasks.clear(); ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ToolChain::Language::Cxx); if (!tc) { m_tasks.append(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."), Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); return true; // otherwise the tasks will not get reported } ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); // Force output to english for the parsers. Do this here and not in the toolchain's // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommand(makeCommand(bc->environment())); pp->setArguments(allArguments()); pp->resolveAll(); setOutputParser(new GnuMakeParser()); IOutputParser *parser = target()->kit()->createOutputParser(); if (parser) appendOutputParser(parser); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(earlierSteps); }
void GenericMakeStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_makeStep->buildConfiguration(); if (!bc) bc = m_makeStep->target()->activeBuildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(bc->buildDirectory().toString()); param.setEnvironment(bc->environment()); param.setCommand(m_makeStep->makeCommand(bc->environment())); param.setArguments(m_makeStep->allArguments()); m_summaryText = param.summary(displayName()); emit updateSummary(); }
ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : m_step(step) { m_ui.setupUi(this); m_ui.command->setExpectedKind(Utils::PathChooser::Command); m_ui.command->setHistoryCompleter(QLatin1String("PE.ProcessStepCommand.History")); m_ui.workingDirectory->setExpectedKind(Utils::PathChooser::Directory); BuildConfiguration *bc = m_step->buildConfiguration(); if (!bc) bc = m_step->target()->activeBuildConfiguration(); Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment(); m_ui.command->setEnvironment(env); m_ui.command->setPath(m_step->command()); m_ui.workingDirectory->setEnvironment(env); m_ui.workingDirectory->setPath(m_step->workingDirectory()); m_ui.commandArgumentsLineEdit->setText(m_step->arguments()); updateDetails(); connect(m_ui.command, SIGNAL(rawPathChanged(QString)), this, SLOT(commandLineEditTextEdited())); connect(m_ui.workingDirectory, SIGNAL(rawPathChanged(QString)), this, SLOT(workingDirectoryLineEditTextEdited())); connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(QString)), this, SLOT(commandArgumentsLineEditTextEdited())); }
bool IosPresetBuildStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); if (!bc) bc = target()->activeBuildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); pp->setCommand(command()); pp->setArguments(Utils::QtcProcess::joinArgs(arguments())); pp->resolveAll(); // If we are cleaning, then build can fail with an error code, but that doesn't mean // we should stop the clean queue // That is mostly so that rebuild works on an already clean project setIgnoreReturnValue(m_clean); setOutputParser(target()->kit()->createOutputParser()); if (outputParser()) outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(earlierSteps); }
ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : BuildStepConfigWidget(step), m_step(step) { m_ui.setupUi(this); m_ui.command->setExpectedKind(Utils::PathChooser::Command); m_ui.command->setHistoryCompleter("PE.ProcessStepCommand.History"); m_ui.workingDirectory->setExpectedKind(Utils::PathChooser::Directory); BuildConfiguration *bc = m_step->buildConfiguration(); Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment(); m_ui.command->setEnvironment(env); m_ui.command->setPath(m_step->command()); m_ui.workingDirectory->setEnvironment(env); m_ui.workingDirectory->setPath(m_step->workingDirectory()); m_ui.commandArgumentsLineEdit->setText(m_step->arguments()); updateDetails(); connect(m_ui.command, &Utils::PathChooser::rawPathChanged, this, &ProcessStepConfigWidget::commandLineEditTextEdited); connect(m_ui.workingDirectory, &Utils::PathChooser::rawPathChanged, this, &ProcessStepConfigWidget::workingDirectoryLineEditTextEdited); connect(m_ui.commandArgumentsLineEdit, &QLineEdit::textEdited, this, &ProcessStepConfigWidget::commandArgumentsLineEditTextEdited); Core::VariableChooser::addSupportForChildWidgets(this, m_step->macroExpander()); }
bool MakeStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); if (!bc) bc = target()->activeBuildConfiguration(); if (!bc) emit addTask(Task::buildConfigurationMissingTask()); ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit()); if (!tc) emit addTask(Task::compilerMissingTask()); if (!tc || !bc) { emitFaultyConfigurationMessage(); return false; } QString arguments = Utils::QtcProcess::joinArgs(m_buildTargets); Utils::QtcProcess::addArgs(&arguments, additionalArguments()); setIgnoreReturnValue(m_clean); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); Utils::Environment env = bc->environment(); // Force output to english for the parsers. Do this here and not in the toolchain's // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setWorkingDirectory(bc->buildDirectory().toString()); pp->setCommand(tc ? tc->makeCommand(bc->environment()) : QLatin1String("make")); pp->setArguments(arguments); pp->resolveAll(); setOutputParser(new GnuMakeParser()); IOutputParser *parser = target()->kit()->createOutputParser(); if (parser) appendOutputParser(parser); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(earlierSteps); }
void AutogenStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_autogenStep->buildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->buildDirectory()); param.setCommand(QLatin1String("autogen.sh")); param.setArguments(m_autogenStep->additionalArguments()); m_summaryText = param.summary(displayName()); emit updateSummary(); }
bool AutogenStep::init() { BuildConfiguration *bc = buildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(bc->buildDirectory()); pp->setCommand(QLatin1String("autogen.sh")); pp->setArguments(additionalArguments()); return AbstractProcessStep::init(); }
void ConfigureStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_configureStep->buildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->buildDirectory().toString()); param.setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure")); param.setArguments(m_configureStep->additionalArguments()); m_summaryText = param.summaryInWorkdir(displayName()); emit updateSummary(); }
bool ProcessStep::init() { BuildConfiguration *bc = buildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(workingDirectory()); pp->setCommand(m_command); pp->setArguments(m_arguments); AbstractProcessStep::setEnabled(m_enabled); setOutputParser(bc->createOutputParser()); return AbstractProcessStep::init(); }
bool ProcessStep::init() { BuildConfiguration *bc = buildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander()); pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment()); pp->setWorkingDirectory(workingDirectory()); pp->setCommand(m_command); pp->setArguments(m_arguments); pp->resolveAll(); setOutputParser(target()->kit()->createOutputParser()); return AbstractProcessStep::init(); }
bool ConfigureStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(bc->buildDirectory().toString()); pp->setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure")); pp->setArguments(additionalArguments()); pp->resolveAll(); return AbstractProcessStep::init(earlierSteps); }
bool AutogenStep::init() { BuildConfiguration *bc = buildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); const QString projectDir(bc->target()->project()->projectDirectory().toString()); pp->setWorkingDirectory(projectDir); pp->setCommand(QLatin1String("./autogen.sh")); pp->setArguments(additionalArguments()); pp->resolveAll(); return AbstractProcessStep::init(); }
void MakeStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_makeStep->buildConfiguration(); if (!bc) bc = m_makeStep->target()->activeBuildConfiguration(); ToolChain *tc = ToolChainKitInformation::toolChain(m_makeStep->target()->kit()); if (tc) { QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets); Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments()); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->buildDirectory().toString()); param.setCommand(tc->makeCommand(bc->environment())); param.setArguments(arguments); m_summaryText = param.summary(displayName()); } else { m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>"); } emit updateSummary(); }
void IosPresetBuildStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_buildStep->buildConfiguration(); if (!bc) bc = m_buildStep->target()->activeBuildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(bc->buildDirectory().toString()); param.setEnvironment(bc->environment()); param.setCommand(m_buildStep->command()); param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->arguments())); m_summaryText = param.summary(displayName()); emit updateSummary(); }
void ProcessStepConfigWidget::updateDetails() { QString displayName = m_step->displayName(); if (displayName.isEmpty()) displayName = tr("Custom Process Step"); ProcessParameters param; BuildConfiguration *bc = m_step->buildConfiguration(); param.setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander()); param.setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment()); param.setWorkingDirectory(m_step->workingDirectory()); param.setCommand(m_step->command()); param.setArguments(m_step->arguments()); m_summaryText = param.summary(displayName); emit updateSummary(); }
void ProcessStepConfigWidget::updateDetails() { QString displayName = m_step->displayName(); if (displayName.isEmpty()) displayName = tr("Custom Process Step"); ProcessParameters param; BuildConfiguration *bc = m_step->buildConfiguration(); if (!bc) // iff the step is actually in the deploy list bc = m_step->target()->activeBuildConfiguration(); param.setMacroExpander(bc ? bc->macroExpander() : Core::VariableManager::macroExpander()); param.setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment()); param.setWorkingDirectory(m_step->workingDirectory()); param.setCommand(m_step->command()); param.setArguments(m_step->arguments()); m_summaryText = param.summary(displayName); emit updateSummary(); }
bool IosBuildStep::init() { BuildConfiguration *bc = buildConfiguration(); if (!bc) bc = target()->activeBuildConfiguration(); if (!bc) emit addTask(Task::buildConfigurationMissingTask()); ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit()); if (!tc) emit addTask(Task::compilerMissingTask()); if (!bc || !tc) { emitFaultyConfigurationMessage(); return false; } ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); // Force output to english for the parsers. Do this here and not in the toolchain's // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommand(buildCommand()); pp->setArguments(Utils::QtcProcess::joinArgs(allArguments())); pp->resolveAll(); // If we are cleaning, then build can fail with an error code, but that doesn't mean // we should stop the clean queue // That is mostly so that rebuild works on an already clean project setIgnoreReturnValue(m_clean); setOutputParser(new GnuMakeParser()); IOutputParser *parser = target()->kit()->createOutputParser(); if (parser) appendOutputParser(parser); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(); }
bool IosBuildStep::init() { BuildConfiguration *bc = buildConfiguration(); if (!bc) bc = target()->activeBuildConfiguration(); ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit()); if (!tc) { Task t = Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit preferences."), Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); emit addTask(t); emit addOutput(tr("Configuration is faulty. Check the Issues output pane for details."), BuildStep::MessageOutput); return false; } ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); // Force output to english for the parsers. Do this here and not in the toolchain's // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommand(buildCommand()); pp->setArguments(Utils::QtcProcess::joinArgs(allArguments())); pp->resolveAll(); // If we are cleaning, then build can fail with an error code, but that doesn't mean // we should stop the clean queue // That is mostly so that rebuild works on an already clean project setIgnoreReturnValue(m_clean); setOutputParser(new GnuMakeParser()); IOutputParser *parser = target()->kit()->createOutputParser(); if (parser) appendOutputParser(parser); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(); }
void GenericMakeStepConfigWidget::updateMakeOverrrideLabel() { BuildConfiguration *bc = m_makeStep->buildConfiguration(); if (!bc) bc = m_makeStep->target()->activeBuildConfiguration(); m_ui->makeLabel->setText(tr("Override %1:").arg(QDir::toNativeSeparators(m_makeStep->makeCommand(bc->environment())))); }