Commit 8a0c8081 authored by Christian Kandeler's avatar Christian Kandeler Committed by Joerg Bornemann

Update qbs submodule.

Plus some minor adjustments in the qbs project manager to an API change.

Change-Id: I41ea8571fee7ec666344464ecc4f808bf92f13ce
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent c884f629
......@@ -117,7 +117,7 @@ void QbsBuildStep::run(QFutureInterface<bool> &fi)
QbsProject *pro = static_cast<QbsProject *>(project());
qbs::BuildOptions options(m_qbsBuildOptions);
options.changedFiles = m_changedFiles;
options.setChangedFiles(m_changedFiles);
m_job = pro->build(options);
......@@ -180,17 +180,17 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
bool QbsBuildStep::dryRun() const
{
return m_qbsBuildOptions.dryRun;
return m_qbsBuildOptions.dryRun();
}
bool QbsBuildStep::keepGoing() const
{
return m_qbsBuildOptions.keepGoing;
return m_qbsBuildOptions.keepGoing();
}
int QbsBuildStep::maxJobs() const
{
return m_qbsBuildOptions.maxJobCount;
return m_qbsBuildOptions.maxJobCount();
}
bool QbsBuildStep::fromMap(const QVariantMap &map)
......@@ -199,9 +199,9 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
return false;
setQbsConfiguration(map.value(QLatin1String(QBS_CONFIG)).toMap());
m_qbsBuildOptions.dryRun = map.value(QLatin1String(QBS_DRY_RUN)).toBool();
m_qbsBuildOptions.keepGoing = map.value(QLatin1String(QBS_KEEP_GOING)).toBool();
m_qbsBuildOptions.maxJobCount = map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt();
m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool());
m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool());
m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt());
return true;
}
......@@ -209,9 +209,9 @@ QVariantMap QbsBuildStep::toMap() const
{
QVariantMap map = ProjectExplorer::BuildStep::toMap();
map.insert(QLatin1String(QBS_CONFIG), m_qbsConfiguration);
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun);
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing);
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount);
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun());
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing());
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount());
return map;
}
......@@ -220,7 +220,7 @@ void QbsBuildStep::buildingDone(bool success)
// Report errors:
foreach (const qbs::ErrorData &data, m_job->error().entries())
createTaskAndOutput(ProjectExplorer::Task::Error, data.description(),
data.codeLocation().fileName, data.codeLocation().line);
data.codeLocation().fileName(), data.codeLocation().line());
QTC_ASSERT(m_fi, return);
m_fi->reportResult(success);
......@@ -250,7 +250,7 @@ void QbsBuildStep::handleWarningReport(const qbs::Error &error)
{
foreach (const qbs::ErrorData &data, error.entries()) {
createTaskAndOutput(ProjectExplorer::Task::Warning, data.description(),
data.codeLocation().fileName, data.codeLocation().line);
data.codeLocation().fileName(), data.codeLocation().line());
}
}
......@@ -262,17 +262,17 @@ void QbsBuildStep::handleCommandDescriptionReport(const QString &highlight, cons
void QbsBuildStep::handleProcessResultReport(const qbs::ProcessResult &result)
{
bool hasOutput = !result.stdOut.isEmpty() || !result.stdErr.isEmpty();
bool hasOutput = !result.stdOut().isEmpty() || !result.stdErr().isEmpty();
if (result.success && !hasOutput && !m_showCompilerOutput)
if (result.success() && !hasOutput && !m_showCompilerOutput)
return;
m_parser->setWorkingDirectory(result.workingDirectory);
foreach (const QString &line, result.stdErr) {
m_parser->setWorkingDirectory(result.workingDirectory());
foreach (const QString &line, result.stdErr()) {
m_parser->stdError(line);
addOutput(line, ErrorOutput);
}
foreach (const QString &line, result.stdOut) {
foreach (const QString &line, result.stdOut()) {
m_parser->stdOutput(line);
addOutput(line, NormalOutput);
}
......@@ -307,25 +307,25 @@ QString QbsBuildStep::profile() const
void QbsBuildStep::setDryRun(bool dr)
{
if (m_qbsBuildOptions.dryRun == dr)
if (m_qbsBuildOptions.dryRun() == dr)
return;
m_qbsBuildOptions.dryRun = dr;
m_qbsBuildOptions.setDryRun(dr);
emit qbsBuildOptionsChanged();
}
void QbsBuildStep::setKeepGoing(bool kg)
{
if (m_qbsBuildOptions.keepGoing == kg)
if (m_qbsBuildOptions.keepGoing() == kg)
return;
m_qbsBuildOptions.keepGoing = kg;
m_qbsBuildOptions.setKeepGoing(kg);
emit qbsBuildOptionsChanged();
}
void QbsBuildStep::setMaxJobs(int jobcount)
{
if (m_qbsBuildOptions.maxJobCount == jobcount)
if (m_qbsBuildOptions.maxJobCount() == jobcount)
return;
m_qbsBuildOptions.maxJobCount = jobcount;
m_qbsBuildOptions.setMaxJobCount(jobcount);
emit qbsBuildOptionsChanged();
}
......@@ -381,7 +381,7 @@ void QbsBuildStepConfigWidget::updateState()
command += QLatin1String("--dryRun ");
if (m_step->keepGoing())
command += QLatin1String("--keepGoing ");
if (m_step->maxJobs() != defaultOptions.maxJobCount)
if (m_step->maxJobs() != defaultOptions.maxJobCount())
command += QString::fromLatin1("--jobs %1 ").arg(m_step->maxJobs());
command += QString::fromLatin1("build profile:%1 %2").arg(m_step->profile(), buildVariant);
......
......@@ -134,12 +134,12 @@ void QbsCleanStep::cancel()
bool QbsCleanStep::dryRun() const
{
return m_qbsCleanOptions.dryRun;
return m_qbsCleanOptions.dryRun();
}
bool QbsCleanStep::keepGoing() const
{
return m_qbsCleanOptions.keepGoing;
return m_qbsCleanOptions.keepGoing();
}
int QbsCleanStep::maxJobs() const
......@@ -149,7 +149,7 @@ int QbsCleanStep::maxJobs() const
bool QbsCleanStep::cleanAll() const
{
return m_qbsCleanOptions.cleanType == qbs::CleanOptions::CleanupAll;
return m_qbsCleanOptions.cleanType() == qbs::CleanOptions::CleanupAll;
}
bool QbsCleanStep::fromMap(const QVariantMap &map)
......@@ -157,10 +157,10 @@ bool QbsCleanStep::fromMap(const QVariantMap &map)
if (!ProjectExplorer::BuildStep::fromMap(map))
return false;
m_qbsCleanOptions.dryRun = map.value(QLatin1String(QBS_DRY_RUN)).toBool();
m_qbsCleanOptions.keepGoing = map.value(QLatin1String(QBS_KEEP_GOING)).toBool();
m_qbsCleanOptions.cleanType = map.value(QLatin1String(QBS_CLEAN_ALL)).toBool()
? qbs::CleanOptions::CleanupAll : qbs::CleanOptions::CleanupTemporaries;
m_qbsCleanOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool());
m_qbsCleanOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool());
m_qbsCleanOptions.setCleanType(map.value(QLatin1String(QBS_CLEAN_ALL)).toBool()
? qbs::CleanOptions::CleanupAll : qbs::CleanOptions::CleanupTemporaries);
return true;
}
......@@ -168,10 +168,10 @@ bool QbsCleanStep::fromMap(const QVariantMap &map)
QVariantMap QbsCleanStep::toMap() const
{
QVariantMap map = ProjectExplorer::BuildStep::toMap();
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsCleanOptions.dryRun);
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsCleanOptions.keepGoing);
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsCleanOptions.dryRun());
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsCleanOptions.keepGoing());
map.insert(QLatin1String(QBS_CLEAN_ALL),
m_qbsCleanOptions.cleanType == qbs::CleanOptions::CleanupAll);
m_qbsCleanOptions.cleanType() == qbs::CleanOptions::CleanupAll);
return map;
}
......@@ -181,7 +181,7 @@ void QbsCleanStep::cleaningDone(bool success)
// Report errors:
foreach (const qbs::ErrorData &data, m_job->error().entries()) {
createTaskAndOutput(ProjectExplorer::Task::Error, data.description(),
data.codeLocation().fileName, data.codeLocation().line);
data.codeLocation().fileName(), data.codeLocation().line());
}
QTC_ASSERT(m_fi, return);
......@@ -217,17 +217,17 @@ void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, con
void QbsCleanStep::setDryRun(bool dr)
{
if (m_qbsCleanOptions.dryRun == dr)
if (m_qbsCleanOptions.dryRun() == dr)
return;
m_qbsCleanOptions.dryRun = dr;
m_qbsCleanOptions.setDryRun(dr);
emit changed();
}
void QbsCleanStep::setKeepGoing(bool kg)
{
if (m_qbsCleanOptions.keepGoing == kg)
if (m_qbsCleanOptions.keepGoing() == kg)
return;
m_qbsCleanOptions.keepGoing = kg;
m_qbsCleanOptions.setKeepGoing(kg);
emit changed();
}
......@@ -241,9 +241,9 @@ void QbsCleanStep::setCleanAll(bool ca)
{
qbs::CleanOptions::CleanType newType = ca
? qbs::CleanOptions::CleanupAll : qbs::CleanOptions::CleanupTemporaries;
if (m_qbsCleanOptions.cleanType == newType)
if (m_qbsCleanOptions.cleanType() == newType)
return;
m_qbsCleanOptions.cleanType = newType;
m_qbsCleanOptions.setCleanType(newType);
emit changed();
}
......@@ -295,7 +295,7 @@ void QbsCleanStepConfigWidget::updateState()
command += QLatin1String("--dryRun ");
if (m_step->keepGoing())
command += QLatin1String("--keepGoing ");
if (m_step->maxJobs() != defaultOptions.maxJobCount)
if (m_step->maxJobs() != defaultOptions.maxJobCount())
command += QString::fromLatin1("--jobs %1 ").arg(m_step->maxJobs());
if (m_step->cleanAll())
command += QLatin1String(" --all-artifacts");
......
......@@ -237,20 +237,20 @@ void QbsGroupNode::setGroup(const qbs::GroupData *group)
if (group == m_group)
return;
setPath(group->location().fileName);
setPath(group->location().fileName());
setDisplayName(group->name());
// Set Product file node used to jump to the product
QbsFileNode *indexFile = 0;
if (!m_group) {
indexFile = new QbsFileNode(group->location().fileName,
indexFile = new QbsFileNode(group->location().fileName(),
ProjectExplorer::ProjectFileType, false,
group->location().line);
group->location().line());
addFileNodes(QList<ProjectExplorer::FileNode *>() << indexFile, this);
} else {
indexFile = static_cast<QbsFileNode *>(fileNodes().first());
indexFile->setPath(group->location().fileName);
indexFile->setLine(group->location().line);
indexFile->setPath(group->location().fileName());
indexFile->setLine(group->location().line());
indexFile->emitNodeUpdated();
}
......@@ -328,7 +328,7 @@ void QbsGroupNode::setupFolders(ProjectExplorer::FolderNode *root, FileTreeNode
// --------------------------------------------------------------------
QbsProductNode::QbsProductNode(const qbs::ProductData *prd) :
QbsBaseProjectNode(prd->location().fileName),
QbsBaseProjectNode(prd->location().fileName()),
m_product(0)
{
setProduct(prd);
......@@ -345,20 +345,20 @@ void QbsProductNode::setProduct(const qbs::ProductData *prd)
return;
setDisplayName(prd->name());
setPath(prd->location().fileName);
setPath(prd->location().fileName());
// Set Product file node used to jump to the product
QList<ProjectExplorer::FileNode *> files = fileNodes();
if (files.isEmpty()) {
addFileNodes(QList<ProjectExplorer::FileNode *>()
<< new QbsFileNode(prd->location().fileName,
<< new QbsFileNode(prd->location().fileName(),
ProjectExplorer::ProjectFileType, false,
prd->location().line),
prd->location().line()),
this);
} else {
QbsFileNode *qbsFile = static_cast<QbsFileNode *>(files.at(0));
qbsFile->setPath(prd->location().fileName);
qbsFile->setLine(prd->location().line);
qbsFile->setPath(prd->location().fileName());
qbsFile->setLine(prd->location().line());
}
QList<ProjectExplorer::ProjectNode *> toAdd;
......
......@@ -312,8 +312,8 @@ void QbsProject::generateErrors(const qbs::Error &e)
foreach (const qbs::ErrorData &data, e.entries())
taskHub()->addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error,
data.description(),
Utils::FileName::fromString(data.codeLocation().fileName),
data.codeLocation().line,
Utils::FileName::fromString(data.codeLocation().fileName()),
data.codeLocation().line(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
......@@ -326,14 +326,14 @@ void QbsProject::parse(const QVariantMap &config, const QString &dir)
QTC_ASSERT(!m_qbsSetupProjectJob, return);
qbs::SetupProjectParameters params;
params.buildConfiguration = m_qbsBuildConfig;
params.buildRoot = m_qbsBuildRoot;
params.projectFilePath = m_fileName;
params.ignoreDifferentProjectFilePath = false;
params.setBuildConfiguration(m_qbsBuildConfig);
params.setBuildRoot(m_qbsBuildRoot);
params.setProjectFilePath(m_fileName);
params.setIgnoreDifferentProjectFilePath(false);
qbs::Preferences *prefs = QbsManager::preferences();
const QString buildDir = qbsBuildDir();
params.searchPaths = prefs->searchPaths(buildDir);
params.pluginPaths = prefs->pluginPaths(buildDir);
params.setSearchPaths(prefs->searchPaths(buildDir));
params.setPluginPaths(prefs->pluginPaths(buildDir));
m_qbsSetupProjectJob
= qbs::Project::setupProject(params, m_manager->settings(), m_manager->logSink(), 0);
......@@ -373,9 +373,9 @@ void QbsProject::updateDocuments(const qbs::ProjectData *prj)
newFiles.insert(m_fileName); // make sure we always have the project file...
if (prj) {
newFiles.insert(prj->location().fileName);
newFiles.insert(prj->location().fileName());
foreach (const qbs::ProductData &prd, prj->products())
newFiles.insert(prd.location().fileName);
newFiles.insert(prd.location().fileName());
}
QSet<QString> oldFiles;
foreach (Core::IDocument *doc, m_qbsDocuments)
......
......@@ -65,7 +65,7 @@ QbsStep::QbsStep(ProjectExplorer::BuildStepList *bsl, Core::Id id) :
ProjectExplorer::BuildStep(bsl, id),
m_job(0)
{
m_qbsBuildOptions.maxJobCount = QbsManager::preferences()->jobs();
m_qbsBuildOptions.setMaxJobCount(QbsManager::preferences()->jobs());
}
QbsStep::QbsStep(ProjectExplorer::BuildStepList *bsl, const QbsStep *other) :
......@@ -137,17 +137,17 @@ void QbsStep::cancel()
bool QbsStep::dryRun() const
{
return m_qbsBuildOptions.dryRun;
return m_qbsBuildOptions.dryRun();
}
bool QbsStep::keepGoing() const
{
return m_qbsBuildOptions.keepGoing;
return m_qbsBuildOptions.keepGoing();
}
int QbsStep::maxJobs() const
{
return m_qbsBuildOptions.maxJobCount;
return m_qbsBuildOptions.maxJobCount();
}
bool QbsStep::fromMap(const QVariantMap &map)
......@@ -155,12 +155,12 @@ bool QbsStep::fromMap(const QVariantMap &map)
if (!ProjectExplorer::BuildStep::fromMap(map))
return false;
m_qbsBuildOptions.dryRun = map.value(QLatin1String(QBS_DRY_RUN)).toBool();
m_qbsBuildOptions.keepGoing = map.value(QLatin1String(QBS_KEEP_GOING)).toBool();
m_qbsBuildOptions.maxJobCount = map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt();
m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool());
m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool());
m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt());
if (m_qbsBuildOptions.maxJobCount <= 0)
m_qbsBuildOptions.maxJobCount = QbsManager::preferences()->jobs();
if (m_qbsBuildOptions.maxJobCount() <= 0)
m_qbsBuildOptions.setMaxJobCount(QbsManager::preferences()->jobs());
return true;
}
......@@ -168,9 +168,9 @@ bool QbsStep::fromMap(const QVariantMap &map)
QVariantMap QbsStep::toMap() const
{
QVariantMap map = ProjectExplorer::BuildStep::toMap();
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun);
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing);
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount);
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun());
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing());
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount());
return map;
}
......@@ -180,7 +180,7 @@ void QbsStep::jobDone(bool success)
if (m_job) {
foreach (const qbs::ErrorData &data, m_job->error().entries())
createTaskAndOutput(ProjectExplorer::Task::Error, data.description(),
data.codeLocation().fileName, data.codeLocation().line);
data.codeLocation().fileName(), data.codeLocation().line());
m_job->deleteLater();
m_job = 0;
}
......@@ -218,25 +218,25 @@ void QbsStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QS
void QbsStep::setDryRun(bool dr)
{
if (m_qbsBuildOptions.dryRun == dr)
if (m_qbsBuildOptions.dryRun() == dr)
return;
m_qbsBuildOptions.dryRun = dr;
m_qbsBuildOptions.setDryRun(dr);
emit qbsBuildOptionsChanged();
}
void QbsStep::setKeepGoing(bool kg)
{
if (m_qbsBuildOptions.keepGoing == kg)
if (m_qbsBuildOptions.keepGoing() == kg)
return;
m_qbsBuildOptions.keepGoing = kg;
m_qbsBuildOptions.setKeepGoing(kg);
emit qbsBuildOptionsChanged();
}
void QbsStep::setMaxJobs(int jobcount)
{
if (m_qbsBuildOptions.maxJobCount == jobcount)
if (m_qbsBuildOptions.maxJobCount() == jobcount)
return;
m_qbsBuildOptions.maxJobCount = jobcount;
m_qbsBuildOptions.setMaxJobCount(jobcount);
emit qbsBuildOptionsChanged();
}
......
Subproject commit 29bb66d2fdc863fd5e9b0896fbd862c5b999d541
Subproject commit 32ae53690c01e5269ac2a9ad0dadf549ce04ee3f
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment