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); }
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); }
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())); }
void AutogenStep::run(QFutureInterface<bool> &interface) { BuildConfiguration *bc = buildConfiguration(); // Check whether we need to run autogen.sh const QString projectDir(bc->target()->project()->projectDirectory().toString()); const QFileInfo configureInfo(projectDir + QLatin1String("/configure")); const QFileInfo configureAcInfo(projectDir + QLatin1String("/configure.ac")); const QFileInfo makefileAmInfo(projectDir + QLatin1String("/Makefile.am")); if (!configureInfo.exists() || configureInfo.lastModified() < configureAcInfo.lastModified() || configureInfo.lastModified() < makefileAmInfo.lastModified()) { m_runAutogen = true; } if (!m_runAutogen) { emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::MessageOutput); interface.reportResult(true); emit finished(); return; } m_runAutogen = false; AbstractProcessStep::run(interface); }
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()); }
void DeployConfiguration::ctor() { Utils::MacroExpander *expander = macroExpander(); expander->setDisplayName(tr("Deploy Settings")); expander->setAccumulating(true); expander->registerSubProvider([this]() -> Utils::MacroExpander * { BuildConfiguration *bc = target()->activeBuildConfiguration(); return bc ? bc->macroExpander() : target()->macroExpander(); }); }
ProjectExplorer::Abi RunConfiguration::abi() const { BuildConfiguration *bc = target()->activeBuildConfiguration(); if (!bc) return Abi::hostAbi(); ToolChain *tc = bc->toolChain(); if (!tc) return Abi::hostAbi(); return tc->targetAbi(); }
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 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 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(); }
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 ? 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); }
void Project::createDefaultConfigs() { for (int i = 0; i < 2; ++i) { addNewConfiguration (nullptr); BuildConfiguration config = getConfiguration (i); const bool debugConfig = i == 0; config.getName() = debugConfig ? "Debug" : "Release"; config.isDebug() = debugConfig; config.getOptimisationLevel() = debugConfig ? 1 : 2; config.getTargetBinaryName() = getProjectFilenameRoot(); } }
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 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 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(); }
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 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())))); }
int main(int argc, char *argv[]) { // Get the current dir as the build directory SmallVector<char, 256> cwd; path::getCurrentDir(cwd); // Initialize the garbage collector GC::init(); //GC::setDebugLevel(1); // Create the project and set the build directory. BuildConfiguration * bc = new BuildConfiguration(); bc->setBuildRoot(cwd); // Parse input parameters. parseInputParams(bc, cwd, argc, argv); GC::uninit(); return 0; }
//============================================================================== StringPairArray ProjectExporter::getAllPreprocessorDefs (const BuildConfiguration& config, const ProjectType::Target::Type targetType) const { StringPairArray defs (mergePreprocessorDefs (config.getAllPreprocessorDefs(), parsePreprocessorDefs (getExporterPreprocessorDefsString()))); addDefaultPreprocessorDefs (defs); addTargetSpecificPreprocessorDefs (defs, targetType); return defs; }
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 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); }
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 ConfigureStep::run(QFutureInterface<bool>& fi) { BuildConfiguration *bc = buildConfiguration(); //Check whether we need to run configure const QString projectDir(bc->target()->project()->projectDirectory().toString()); const QFileInfo configureInfo(projectDir + QLatin1String("/configure")); const QFileInfo configStatusInfo(bc->buildDirectory().toString() + QLatin1String("/config.status")); if (!configStatusInfo.exists() || configStatusInfo.lastModified() < configureInfo.lastModified()) { m_runConfigure = true; } if (!m_runConfigure) { emit addOutput(tr("Configuration unchanged, skipping configure step."), BuildStep::MessageOutput); reportRunResult(fi, true); return; } m_runConfigure = false; AbstractProcessStep::run(fi); }
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(); }