void QbsBuildStep::setQbsConfiguration(const QVariantMap &config) { QbsProject *pro = static_cast<QbsProject *>(project()); QVariantMap tmp = config; tmp.insert(QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY), pro->projectManager()->profileForKit(target()->kit())); if (!tmp.contains(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY))) tmp.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY), QString::fromLatin1(Constants::QBS_VARIANT_DEBUG)); if (tmp == m_qbsConfiguration) return; m_qbsConfiguration = tmp; QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); if (bc) bc->emitBuildTypeChanged(); emit qbsConfigurationChanged(); }
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(); }
bool AbstractRemoteLinuxDeployStep::isDeploymentPossible(QString *whyNot) const { deployService()->setDeviceConfiguration(deployConfiguration()->deviceConfiguration()); deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(buildConfiguration())); return deployService()->isDeploymentPossible(whyNot); }
bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) { if (AndroidManager::checkForQt51Files(project()->projectDirectory())) emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput); if (!AndroidBuildApkStep::init(earlierSteps)) return false; QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); if (!version) return false; QString command = version->qmakeProperty("QT_HOST_BINS"); if (!command.endsWith(QLatin1Char('/'))) command += QLatin1Char('/'); command += QLatin1String("androiddeployqt"); if (Utils::HostOsInfo::isWindowsHost()) command += QLatin1String(".exe"); QString deploymentMethod; if (m_deployAction == MinistroDeployment) deploymentMethod = QLatin1String("ministro"); else if (m_deployAction == DebugDeployment) deploymentMethod = QLatin1String("debug"); else if (m_deployAction == BundleLibrariesDeployment) deploymentMethod = QLatin1String("bundled"); ProjectExplorer::BuildConfiguration *bc = buildConfiguration(); QString outputDir = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString(); const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(project()); const QmakeProjectManager::QmakeProFileNode *node = pro->rootProjectNode()->findProFileFor(proFilePathForInputFile()); m_skipBuilding = !node; if (m_skipBuilding) return true; QString inputFile = node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile); if (inputFile.isEmpty()) { m_skipBuilding = true; return true; } QStringList arguments; arguments << QLatin1String("--input") << inputFile << QLatin1String("--output") << outputDir << QLatin1String("--deployment") << deploymentMethod << QLatin1String("--android-platform") << AndroidManager::buildTargetSDK(target()) << QLatin1String("--jdk") << AndroidConfigurations::currentConfig().openJDKLocation().toString(); if (m_verbose) arguments << QLatin1String("--verbose"); if (m_useGradle) arguments << QLatin1String("--gradle"); else arguments << QLatin1String("--ant") << AndroidConfigurations::currentConfig().antToolPath().toString(); QStringList argumentsPasswordConcealed = arguments; if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) { if (bc->buildType() == ProjectExplorer::BuildConfiguration::Debug) arguments << QLatin1String("--gdbserver"); else arguments << QLatin1String("--no-gdbserver"); } if (m_signPackage) { arguments << QLatin1String("--sign") << m_keystorePath.toString() << m_certificateAlias << QLatin1String("--storepass") << m_keystorePasswd; argumentsPasswordConcealed << QLatin1String("--sign") << QLatin1String("******") << QLatin1String("--storepass") << QLatin1String("******"); if (!m_certificatePasswd.isEmpty()) { arguments << QLatin1String("--keypass") << m_certificatePasswd; argumentsPasswordConcealed << QLatin1String("--keypass") << QLatin1String("******"); } } ProjectExplorer::ProcessParameters *pp = processParameters(); setupProcessParameters(pp, bc, arguments, command); // Generate arguments with keystore password concealed ProjectExplorer::ProcessParameters pp2; setupProcessParameters(&pp2, bc, argumentsPasswordConcealed, command); m_command = pp2.effectiveCommand(); m_argumentsPasswordConcealed = pp2.prettyArguments(); return true; }