Qbs: Fix build target key of project part

The build target key is the basic mapping of project
part to run configuration and this went out of sync
with the latest refactorings of the Qbs project
manager.
This fixes execution of tests inside the AutoTest
plugin for qbs based projects.

Change-Id: I7d7a703a341df98a015f9c83d3c2a320d46779c3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2020-03-02 09:41:58 +01:00
parent b718f47893
commit 26e4a2a758

View File

@@ -170,6 +170,12 @@ static bool supportsNodeAction(ProjectAction action, const Node *node)
return false;
}
static QString buildKeyValue(const QJsonObject &product)
{
return product.value("name").toString() + '.'
+ product.value("multiplex-configuration-id").toString();
}
QbsBuildSystem::QbsBuildSystem(QbsBuildConfiguration *bc)
: BuildSystem(bc->target()),
m_session(new QbsSession(this)),
@@ -907,7 +913,7 @@ static RawProjectParts generateProjectParts(
rpp.setProjectFileLocation(location.value("file-path").toString(),
location.value("line").toInt(),
location.value("column").toInt());
rpp.setBuildSystemTarget(productName);
rpp.setBuildSystemTarget(buildKeyValue(prd));
rpp.setBuildTargetType(prd.value("is-runnable").toBool()
? BuildTargetType::Executable
: BuildTargetType::Library);
@@ -1069,8 +1075,7 @@ void QbsBuildSystem::updateApplicationTargets()
}
}
BuildTargetInfo bti;
bti.buildKey = productData.value("name").toString() + '.'
+ productData.value("multiplex-configuration-id").toString();
bti.buildKey = buildKeyValue(productData);
bti.targetFilePath = FilePath::fromString(targetFile);
bti.projectFilePath = FilePath::fromString(projectFile);
bti.isQtcRunnable = isQtcRunnable; // Fixed up below.